const path = require('path'); //npm module for absolute path like path.resolve(__dirname, './build')
const webpack = require('webpack');
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
const config = require('./gulp/config.js');
module.exports = {
entry: './'+ config.src.jsEntryPoint,
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, './' + config.dest.js),
},
watch: true, //live-reloading
devtool: 'source-map',
plugins: [
// jQuery globally
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}),
],
// Babel
module: {
rules: [{
test: /\.js$/,
exclude: [/node_modules/],
use: [{
loader: 'babel-loader',
options: { presets: ['es2015'] }
}]
}]
}
};