Depois de realizar todos os passos até o final da aula 11, obtive um erro de módulo @babel/core não encontrado. Instalei esse módulo e agora tenho o seguinte:
ERROR in ./app-src/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions.
(...)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! client@1.0.0 build-dev: `webpack --config webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the client@1.0.0 build-dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
webpack.config.js:
const path = require('path');
module.exports = {
mode: 'development',
entry: './app-src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
}
}
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"
},
"author": "",
"license": "ISC",
"dependencies": {
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"@babel/core": "^7.11.4",
"@babel/preset-env": "^7.11.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.1.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2017": "^6.24.1",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
}
}
Alguém pode dar uma luz? Obrigada!