'use strict';
const gulp = require('gulp');
const webpackStream = require('webpack-stream');
const webpack = require('webpack');
const path = require('path');
gulp.task('bundle', () => {
return gulp.src('./www/src/main.js')
.pipe(webpackStream({
watch: true,
entry: './www/src/main.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: 'babel-loader'
}
]
},
resolve: {
alias: {
src: path.resolve(__dirname, 'src')
}
},
// devtool: 'eval' // production
devtool: 'source-map' // testing
}, webpack))
.pipe(gulp.dest('./www/dist/'));
});