Добрый день! Настраиваю webpack и всплывает ошибка
ERROR in ./es6/scripts.js 23:8
Module parse failed: Unexpected token (23:8)
You may need an appropriate loader to handle this file type.
| }
|
> tick=()=>{
| this.time--;
| this.render();
мой .babelrc
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
мой webpack.config.js
let path = require('path');
let conf = {
entry: './es6/scripts.js',
output:{
path: path.resolve(__dirname,'./js'),
filename: 'main.js',
publicPath: 'js/'
},
devServer: {
overlay:true
},
module: {
rules:[
{
test:'/\.js$/',
loader: 'babel-loader',
//exlude 'node_modules'
}
]
}
};
module.exports = conf;
мой package.json
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --mode development --open",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"babel-loader": "^8.0.5",
"webpack": "^4.31.0",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.3.1"
}
}