Skip to content

Instantly share code, notes, and snippets.

@xingoxu
Created January 22, 2017 11:59
Show Gist options
  • Select an option

  • Save xingoxu/9c73872db5fce038b939ce0cce1e7c01 to your computer and use it in GitHub Desktop.

Select an option

Save xingoxu/9c73872db5fce038b939ce0cce1e7c01 to your computer and use it in GitHub Desktop.
simplist webpack buildjs
var webpack = require('webpack');
const webpackConfig = {
entry: './app.js',
output: {
filename: 'bundle.js',
path: './'
},
module: {
rules: [
]
},
plugins: [
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// })
]
}
webpack(webpackConfig, function (err, stats) {
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment