我已将我的 ionic 应用程序从 beta 11 更新到 rc0。所以这意味着我已经从 angular2 rc4 切换到 angular2 stable,从 typescript 1.8 切换到 2 并使用 rollupjs 模块捆绑器。
我有一个 redux 架构,并且正在使用 Redux 库。
我无法编译并收到此错误:
错误:模块 c:\XXX\node_modules\redux\node_modules\symbol-observable\index.js 不导出默认值(由 c:\XXX\node_modules\redux\es\createStore.js 导入)
在 Module.trace (c:\XXX\node_modules\rollup\dist\rollup.js:7677:29)
在 ModuleScope.findDeclaration (c:\XXX\node_modules\rollup\dist\rollup.js:7300:22)
在 Scope.findDeclaration (c:\XXX\node_modules\rollup\dist\rollup.js:5351:39)
在 Scope.findDeclaration (c:\XXX\node_modules\rollup\dist\rollup.js:5351:39)
在 Identifier.bind (c:\XXX\node_modules\rollup\dist\rollup.js:6489:29)
在 c:\XXX\node_modules\rollup\dist\rollup.js:5151:50
在 MemberExpression.eachChild (c:\XXX\node_modules\rollup\dist\rollup.js:5168:5)
在 MemberExpression.bind (c:\XXX\node_modules\rollup\dist\rollup.js:5151:7)
在 MemberExpression.bind (c:\XXX\node_modules\rollup\dist\rollup.js:6693:24)
在 c:\XXX\node_modules\rollup\dist\rollup.js:5151:50
有人对发生的事情有任何想法吗?有人可以给我一些指示吗?我真的不明白如何处理这个问题。
这就是我在rollup.config.js中的内容
var ngTemplate = require('../dist/plugins/ng-template').ngTemplate;
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
// https://github.com/rollup/rollup/wiki/JavaScript-API
module.exports = {
/**
* entry: The bundle's starting point. This file will
* be included, along with the minimum necessary code
* from its dependencies
*/
entry: './.tmp/app/main.dev.js',
/**
* sourceMap: If true, a separate sourcemap file will
* be created.
*/
sourceMap: true,
/**
* format: The format of the generated bundle
*/
format: 'iife',
/**
* dest: the output filename for the bundle in the buildDir
*/
dest: 'main.js',
// Add this to avoid Eval errors
useStrict: false,
/**
* plugins: Array of plugin objects, or a single plugin object.
* See https://github.com/rollup/rollup/wiki/Plugins for more info.
*/
plugins: [
ngTemplate(),
commonjs({
include: [
'node_modules/rxjs/**',
'node_modules/firebase/**',
'node_modules/angularfire2/**'
],
namedExports: {
'node_modules/firebase/firebase.js': ['initializeApp', 'auth', 'database'],
'node_modules/angularfire2/node_modules/firebase/firebase-browser.js': ['initializeApp', 'auth', 'database']
}
}),
nodeResolve({
module: true,
jsnext: true,
main: true,
browser: true,
extensions: ['.js']
})
]
};