[英]Getting unexpected token error when generating build with react-monaco-editor
Getting following error while executing npm run build
:执行
npm run build
时出现以下错误:
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js??ref--2-1!../../node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css:
2 modules
Child vs/language/typescript/tsWorker:
1 asset
[17] (webpack)/buildin/global.js 509 bytes {0} [built]
[40] (webpack)/buildin/harmony-module.js 596 bytes {0} [built]
+ 40 hidden modules
ERROR in ts.worker.js from UglifyJs
Unexpected token: name (_isWindows) [ts.worker.js:78,4]
webpack config: webpack 配置:
https://github.com/react-monaco-editor/react-monaco-editor/files/6173508/webpack.zip https://github.com/react-monaco-editor/react-monaco-editor/files/6173508/webpack.zip
Solved the problem by upgrading the webpack to version 4 from version 3. This requires upgradation of multiple plugins also, since many of them deprecated and added internally to webpack configuration通过将 webpack 从版本 3 升级到版本 4 解决了该问题。这还需要升级多个插件,因为其中许多插件已弃用并在内部添加到 webpack 配置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.