Skip to content

Instantly share code, notes, and snippets.

@Alecto
Created June 13, 2019 09:32
Show Gist options
  • Save Alecto/d2a41586a5018edc6a2e9879ade606a4 to your computer and use it in GitHub Desktop.
Save Alecto/d2a41586a5018edc6a2e9879ade606a4 to your computer and use it in GitHub Desktop.
Настройки для Webpack
let path = require('path');
let conf = {
entry: './assets/js/main.js',
output: {
path: path.resolve(__dirname, './assets/js'),
filename: 'all.min.js',
publicPath: 'assets/js/'
},
devServer: {overlay: true},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: '/node_modules/'
}
]
}
};
module.exports = (env, options) => {
conf.devtool = options.mode === 'production' ?
false :
'cheap-module-eval-source-map';
return conf;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment