Skip to content

Instantly share code, notes, and snippets.

@badnorseman
Created November 7, 2016 18:34
Show Gist options
  • Save badnorseman/c092d2f038e635b0cebb00c2f23b995d to your computer and use it in GitHub Desktop.
Save badnorseman/c092d2f038e635b0cebb00c2f23b995d to your computer and use it in GitHub Desktop.
Webpack for development
var path = require("path");
var webpack = require("webpack");
module.exports = {
devtool: "eval-source-map",
entry: [
"webpack-hot-middleware/client",
"./src/scripts/App.js"
],
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js",
publicPath: "/"
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ["", ".js"]
},
module: {
loaders: [{
test: /\.js$/,
loader: "babel",
exclude: /node_modules/,
include: path.join(__dirname, "/src/scripts")
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
test: /\.(jpg|png)$/,
loader: "url-loader?limit=8192"
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment