建立外部库时遇到了很大的问题。我可以在开发模式下运行它,但不能在静态模式下构建它。
错误:
universalModuleDefinition:1 Uncaught TypeError: Object(...) is not a function
我的webpack
externals: {
react: "React",
"react-dom": "ReactDOM",
"react-redux": "ReactRedux",
redux: "Redux",
"redux-saga": "ReduxSaga",
"redux-thunk": "ReduxThunk",
"custom-library": "CustomLibrary",
"other-library": "OtherLibrary"
},
output: {
library: "MyLibrary",
libraryTarget: "umd",
globalObject: 'this',
path: path.resolve(__dirname, "../../dist")
},