Webpack: Bundle.js - Uncaught ReferenceError: process is not defined

后端 未结 5 1803
轻奢々
轻奢々 2020-12-31 00:06

Here\'s my webpack.config.js

\"use strict\";

module.exports = {
    entry: [\'./main.js\'],
    output: { path: __dirname, filename: \'bund         


        
5条回答
  •  渐次进展
    2020-12-31 00:18

    You need to add a plugin to define your env (in webpack config):

       plugins: [
            new webpack.DefinePlugin({
                'process.env.NODE_ENV': JSON.stringify('development')
            })
        ],
    

提交回复
热议问题