Professor, segue liga nesse erro:
Consta como se não tivesse encontrado o C:\wamp64\www\CursoAlura\webpack\client\webpack.config.js, mas fiz conforme o senhor fez no exercício e com isso, não consigo gerar o bundle.
//Prompt
C:\wamp64\www\CursoAlura\webpack\client>npm run build-dev
> client@1.0.0 build-dev C:\wamp64\www\CursoAlura\webpack\client
> webpack --config webpack.config.js
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'C:\wamp64\www\CursoAlura\webpack\client\webpack.config.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at requireConfig (C:\wamp64\www\CursoAlura\webpack\client\node_modules\webpack\bin\convert-argv.js:97:18)
at C:\wamp64\www\CursoAlura\webpack\client\node_modules\webpack\bin\convert-argv.js:104:17
at Array.forEach (<anonymous>)
at module.exports (C:\wamp64\www\CursoAlura\webpack\client\node_modules\webpack\bin\convert-argv.js:102:15)
at yargs.parse (C:\wamp64\www\CursoAlura\webpack\client\node_modules\webpack\bin\webpack.js:171:41)
at Object.Yargs.self.parse (C:\wamp64\www\CursoAlura\webpack\client\node_modules\yargs\yargs.js:533:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@1.0.0 build-dev: `webpack --config webpack.config.js`
npm ERR! Exit status 1
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yuri.andrade\AppData\Roaming\npm-cache\_logs\2018-10-30T16_56_29_795Z-debug.log
//webpack.config.js
const path = require('path');
module.exports = {
entry: './app-src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/, //os arquivos (node_modules) que não serão processados
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": "^6.26.3",
"babel-loader": "^7.1.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2017": "^6.24.1",
"webpack": "^3.12.0"
}
}
//.babelrc
{
"presets":["es2017"],
"plugins" : ["transform-decorators-legacy"]
}