'use strict' const webpack = require('webpack') const path = require('path') const CopyWebpackPlugin = require('copy-webpack-plugin') module.exports = { entry: { main: './src/js/main' }, output: { path: path.join(__dirname, 'app', 'public'), filename: '[name].js' }, module: { rules: [ { test: /\.js$/, exclude: /(node_modules|bower_components)/, use: { loader: 'babel-loader', options: { presets: [ '@babel/preset-env' ] } } } ] }, plugins: [ new webpack.ProvidePlugin({ // Detect and inject _: 'underscore' }), new CopyWebpackPlugin([{ from: 'src/document/index.html', to: '.' }, { from: 'static', to: 'static' }]) ], devtool: 'inline-source-map' }