2016-10-20 92 views
1

我試圖將推送通知添加到我的Ionic2應用程序。我正在關注this。我的應用程序在做ionic io init作爲ionic2推文檔頁面上提示現在我不斷收到此錯誤每次之前正常工作我做ionic serve包失敗:'CloudModule'未導出

bundle failed: 'CloudModule' is not exported by node_modules/@ionic/cloud-angular/dist/es5/index.js 
      (imported by src/app/app.module.ts). For help fixing this error see https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module 

回答

0

爲了使它工作,我不得不把它添加到我的文件rollup.config.js在here

建議node_modules/@ionic/app-scripts/config/rollup.config.js

module.exports = { 

    [...] 
    useStrict: false, 
    [...] 

    plugins: [ 
    ngTemplate(), 
    commonjs({ 
     include: [ 
     [...] 
     'node_modules/@ionic/cloud-angular/**', 
     'node_modules/superagent/**', 
     'node_modules/@ionic/cloud/node_modules/superagent/**', 
     'node_modeule/emitter/**', 
     'node_modules/reduce-component/**', 
     'node_modules/intl/**', 
     'node_modules/**', 
     ], 
     namedExports: { 
      [...] 
     } 
    }), 
    nodeResolve({ 
     useStrict: false, 
     module: true, 
     jsnext: true, 
     main: true, 
     browser: true, 
     extensions: ['.js'] 
    }) 
    ] 

}; 

即使這使得構建過程緩慢