WebPack - Babel


babel webpack



babel webpack


$ yarn add -D webpack webpack-cli


$ yarn add -D babel-core babel-loader babel-preset-env


$ vi babel.config.json


{
    "presets": ["babel-preset-env"]
}


$ vi webpack.config.js


const path = require('path');

const config = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: 'bundle.js',
  },
};

module.exports = config;


package.json


"webpack": "webpack"


$ yarn webpack


Config for node.js project