Skip to content

Instantly share code, notes, and snippets.

@scott-w
Created October 7, 2017 07:42
Show Gist options
  • Save scott-w/45a0fac10bf70352be23e3a074cb5743 to your computer and use it in GitHub Desktop.
Save scott-w/45a0fac10bf70352be23e3a074cb5743 to your computer and use it in GitHub Desktop.
Webpack configuration
const webpack = require("webpack");
const path = require("path");
module.exports = {
entry: {
app: ["./app/index.js"]
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ["es2015"]
}
},
{
test: /\.html$/,
loader: "underscore-template-loader"
}
]
},
output: {
filename: "bundle.js",
path: path.join(__dirname, "public/js")
},
plugins: [new webpack.ProvidePlugin({ _: "lodash" })],
resolve: {
modules: [__dirname, "app", "node_modules"]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment