var path = require('path');
module.exports = {
entry: './assets/js/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
// Add the JSHint loader
module: {
rules: [{
test: /\.js$/, // Run the loader on all .js files
exclude: /node_modules/, // ignore all files in the node_modules folder
use: 'jshint-loader'
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader?modules', ],
}]
},
plugins: [
// enable HMR globally
new webpack.HotModuleReplacementPlugin(),
//automatically turn vendor files into cached chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'commons',
filename: 'commons.js'
})
],
devtool: 'inline-source-map',
};