Created
August 3, 2016 03:16
-
-
Save damienwebdev/9e41b004b490382d112bfd6119742ea7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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