Estou pegando essa exceção na hora de acessar a página em http://localhost:8080.
Uncaught ReferenceError: __webpack_require__ is not defined
at eval (webpack:///multi_(:8080/webpack)-dev-server/client?:1:1)
at Object.0 (bundle.js:1)
at t (bundle.js:1)
at bundle.js:1
at bundle.js:1
package.json
{
"name": "client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-dev": "webpack --config webpack.config.js",
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.config.js",
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2017": "^6.24.1",
"babili-webpack-plugin": "^0.1.2",
"cross-env": "^6.0.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0"
}
}
webpack.config.js
const path = require('path');
const babiliPlugin = require('babili-webpack-plugin');
let plugins = [];
if (process.env.NODE_ENV = 'production') {
plugins.push(new babiliPlugin());
}
module.exports = {
entry: './app-src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: 'dist'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node-modules/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins
}