Skip to content

Instantly share code, notes, and snippets.

@damienwebdev
Created August 3, 2016 03:16
Show Gist options
  • Save damienwebdev/9e41b004b490382d112bfd6119742ea7 to your computer and use it in GitHub Desktop.
Save damienwebdev/9e41b004b490382d112bfd6119742ea7 to your computer and use it in GitHub Desktop.
gulp.task("webpack-dev-server", function() {
// modify some webpack config options
var myConfig = Object.create(webpackConfig);
// Start a webpack-dev-server
new WebpackDevServer(webpack(myConfig),{
contentBase: 'build',
inline:true
})
.listen(8080, "localhost", function(err) {
if(err) throw new gutil.PluginError("webpack-dev-server", err);
gutil.log("[webpack-dev-server]", "http://localhost:8080/webpack-dev-server/index.html");
});
});
var path = require("path");
var webpack = require("webpack");
module.exports = {
entry: {
app: [
'./app/index.js'
]
},
output: {
path: path.resolve(__dirname, "build"),
publicPath: "/",
filename: '[name].js'
},
devServer: {
contentBase: 'build'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react'],
plugins: ["transform-object-assign"]
}
}
]
},
plugins: [
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment