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

Aula 4 - Importando bootstrap como um módulo

client atilalima$ npm start

> client@1.0.0 start /Users/atilalima/Desktop/Alura/projeto-webpack/client
> webpack-dev-server

sh: webpack-dev-server: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! client@1.0.0 start: `webpack-dev-server`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the client@1.0.0 start 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!     /Users/atilalima/.npm/_logs/2020-10-14T15_54_56_936Z-debug.log

Segui todos os passos do flávio em instalar o style loader, css loader, configure else no webpack.config.js mas tenho essa resposta qdo rodo o npm start como ele faz ao finalzinho do video.

Meu package.json está assim

{
  "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",
    "build-prod": "cross-env NODE_ENV=production webpack --config webpack.config.js",
    "start": "webpack-dev-server"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "reflect-metadata": "^0.1.10"
  },
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2017": "^6.24.1",
    "babili-webpack-plugin": "^0.1.1",
    "bootstrap": "^3.4.1",
    "cross-env": "^5.0.1",
    "css-loader": "^0.28.4",
    "file-loader": "^0.11.2",
    "style-loader": "^0.18.2",
    "url-loader": "^0.5.9",
    "webpack": "^3.1.0"
  }

E o meu webpack.config.js está assim

const path = require('path');
const babiliPlugin = require('babili-webpack-plugin');

let plugins = [];

if (process.env.NODE_ENV == 'production') {
      plugins.push(new babiliPlugin());
}

module.exports = {
    entry: './app-src/app.js',
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist'),
        publicPath: 'dist'
    },
    module: {
    rules: [
        {
    //Provides which types of files need to be considered once webpack is running  
            test: /\.js$/,
    //Provides which files not to be processed once webpack is running      
            exclude: /node_modules/,
    //Specifies the loader which webpack should use      
            use: {
               loader: 'babel-loader'
            }
        },
        {
           test: /\.css$/,
           loader: 'style-loader!css-loader'   
        },
        { 
            test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, 
            loader: 'url-loader?limit=10000&mimetype=application/font-woff' 
        },
        { 
            test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, 
            loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
        },
        { 
            test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, 
            loader: 'file-loader' 
        },
        { 
            test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, 
            loader: 'url-loader?limit=10000&mimetype=image/svg+xml' 
        }            
       ]
    },
    plugins
}

Deve ser algum detalhe que passou despercebido e talvez outro par de olhos sobre o codigo pode me ajudar

Mto obrigado de antemao

1 resposta
solução!

Fala ai Átila, tudo bem? Faltou instalar a dependência webpack-dev-server como devDependency:

npm i -D webpack-dev-server@versao-utilizada-no-curso

Espero ter ajudado.