Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Não consigo entender o erro.

delta@devlink02:~/Documentos/Projetos/webpack-alura1$ npm run build-dev

alurabank@1.0.0 build-dev webpack --mode development --config webpack.config.js

[webpack-cli] Failed to load '/home/delta/Documentos/Projetos/webpack-alura1/webpack.config.js' config [webpack-cli] ReferenceError: required is not defined at Object. (/home/delta/Documentos/Projetos/webpack-alura1/webpack.config.js:1:76) at Module.compile (/home/delta/Documentos/Projetos/webpack-alura1/nodemodules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module.load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (/home/delta/Documentos/Projetos/webpack-alura1/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at loadConfig (/home/delta/Documentos/Projetos/webpack-alura1/node_modules/webpack-cli/lib/webpack-cli.js:1158:31) at /home/delta/Documentos/Projetos/webpack-alura1/node_modules/webpack-cli/lib/webpack-cli.js:1245:74 at Array.map () npm ERR! code 2 npm ERR! path /home/delta/Documentos/Projetos/webpack-alura1 npm ERR! command failed npm ERR! command sh -c webpack --mode development --config webpack.config.js

npm ERR! A complete log of this run can be found in: npm ERR! /home/delta/.npm/logs/2021-08-02T1737_42_523Z-debug.log

1 resposta
solução!

Oi Leonardo!

Aparentemente durante a importação do módulo path você acabou digitando required em vez de require.

O código do webpack.config.js deve ser o seguinte:

const path = require("path");

module.exports = {
 entry: './app/src/js/app.js',
 output: {
   filename: "bundle.js",
   path: path.resolve(__dirname, "app/dist")
 } 
}

Após corrigir, tente rodar npm run build-dev novamente e o tudo deve correr normalmente.

Espero ter ajudado! Qualquer outra dúvida pode postar aqui! :)