2018-07-31

angular 6 universal 遇到的錯誤: echarts 編譯變數 __DEV__ is not defined


npm run server

> ppap@0.0.0 server C:\code\ppap
> node local.js

C:\code\cww\ppap\dist\server.js:108375
            if (__DEV__) {
            ^

ReferenceError: __DEV__ is not defined
    at Function.RootClass.extend (C:\code\cww\ppap\dist\server.js:108375:13)08375:13)                                                            )
    at Object. (C:\code\cww\ppap\dist\server.js:84784:32)                                                                    6)
    at __webpack_require__ (C:\code\cww\ppap\dist\server.js:21:30)
    at Object. (C:\code\cww\ppap\dist\server.js:326569:2\cww\ppap\dist\server.js:49784:23)6)
    at __webpack_require__ (C:\code\cww\ppap\dist\server.js:21:30)
    at Object.module.exports.Object.setPrototypeOf.__proto__ (C:\code\cww\ppap\dist\server.js:49784:23)    at __webpack_require__ (C:\code\cww\ppap\dist\server.js:21:30)
    at Object.module.exports.window.CKEDITOR.window.CKEDITOR.dom.window.CKEDITOR.window.CKEDITOR.a (C:\code\cww\ppap\dist\server.js:327262:18)
    at __webpack_require__ (C:\code\cww\ppap\dist\server.js:21:30)    at Object.echarts (C:\code\cww\ppap\dist\server.js:418523:18)npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ppap@0.0.0 server: `node local.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ppap@0.0.0 server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
在 webpack.server.config.js 中加入
module.exports = {
plugins: [
    new webpack.DefinePlugin({
      __DEV__: false
    })
  ]
}

沒有留言:

adsense