Я играю с приложением react
и представила веб-пакет.стек ошибок консоли относится к react-dom.production.min.js
огромному уменьшенному файлу, а не к конкретному файлу с неопределенной переменной.Отдельные файлы были сопоставлены, но стеки ошибок не относятся к конкретному файлу с ошибкой.
Стек ошибок
ReferenceError: omak is not defined
Stack trace:
render@webpack-internal:///10:124:1
l@webpack-internal:///17:131:336
beginWork@webpack-internal:///17:138:287
e@webpack-internal:///17:176:105
f@webpack-internal:///17:176:379
G@webpack-internal:///17:182:329
x@webpack-internal:///17:181:378
n@webpack-internal:///17:181:221
B@webpack-internal:///17:180:117
v@webpack-internal:///17:179:51
b@webpack-internal:///17:190:302
updateContainer@webpack-internal:///17:191:389
tg.prototype.render@webpack-internal:///17:228:366
Eg/<@webpack-internal:///17:242:473
unbatchedUpdates@webpack-internal:///17:188:42
Eg@webpack-internal:///17:242:392
render@webpack-internal:///17:244:189
@webpack-internal:///20:19:1
@http://127.0.0.1:8080/bundle.js:217:1
__webpack_require__@http://127.0.0.1:8080/bundle.js:20:12
@http://127.0.0.1:8080/bundle.js:69:18
@http://127.0.0.1:8080/bundle.js:1:11
webpack.config.js
const path = require('path');
//const BabiliPlugin = require('babili-webpack-plugin');
module.exports = {
entry: './src/app.js',
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
optimization: {
minimize: false
},
module: {
rules: [{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
}]
},
devtool: 'cheap-module-eval-source-map'
}
Package.json
{
"scripts": {
"serve": "live-server public/",
"build": "webpack --watch",
"build-babel": "babel src/app.js --out-file=public/scripts/app.js --preset=env,react --watch"
},
"dependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "1.5.2",
"babel-preset-react": "^6.24.1",
"babili-webpack-plugin": "^0.1.2",
"live-server": "^1.2.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"validator": "^10.2.0",
"webpack": "^4.8.3"
},
"devDependencies": {
"webpack-cli": "^2.1.3"
}
}
Источники зажигания
1