Skip to content

Instantly share code, notes, and snippets.

@jackmccloy
Created July 20, 2016 16:15
Show Gist options
  • Save jackmccloy/d8f850abdfe3e957c9efe74f14df3f26 to your computer and use it in GitHub Desktop.
Save jackmccloy/d8f850abdfe3e957c9efe74f14df3f26 to your computer and use it in GitHub Desktop.
var path = require("path");
var webpack = require("webpack");
var BundleTracker = require("webpack-bundle-tracker");
module.exports = {
devtool: "eval",
context: __dirname,
entry: {
main: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/only-dev-server",
"./website/Index"
// "./node/js/index"
]
},
output: {
path: path.resolve("./assets/bundles/"),
filename: "[name]-[hash].js",
publicPath: "http://localhost:3000/assets/bundles/"
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(), // don't reload if there is an error
new BundleTracker({filename: "./webpack-stats.json"})
],
module: {
loaders: [{
test: /\.(ttf|eot|otf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader"
},{
test: /\.css$/,
loader: "style!css!autoprefixer?browsers=last 10 versions"
},{
test: /\.scss$/,
loader: "style!css!autoprefixer?browsers=last 10 versions!sass?sourceMap"
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=464600&minetype=application/font-woff"
},{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ["babel-loader"]
}]
},
resolve: {
modulesDirectories: ["node_modules"],
extensions: ["", ".js", ".jsx"]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment