Created
April 6, 2016 21:28
-
-
Save rcolepeterson/4a00ae8c7bf17d74106091af74b8e7e3 to your computer and use it in GitHub Desktop.
webpack.config.js
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
'use strict'; | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var webpack = require('webpack'); | |
var path = require('path'); | |
var config = { | |
entry: './app/index.js', | |
output: { | |
path: './build', | |
filename: 'index_bundle.js' | |
}, | |
module: { | |
loaders: [{ | |
test: /\.js$/, | |
loader: 'babel-loader', | |
exclude: /(node_modules|bower_components)/, | |
query: { | |
cacheDirectory: true, | |
presets: ['es2015'] | |
} | |
}, { | |
test: /\.handlebars$/, | |
loader: 'handlebars' | |
}, { | |
test: /\.css$/, | |
loader: 'style-loader!css-loader', | |
}, { | |
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, | |
loader: 'file-loader' | |
}] | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: './app/templates/index.handlebars', | |
chunks: ['index_bundle.js'] | |
}), | |
new webpack.ProvidePlugin({ | |
$: "jquery", | |
jQuery: "jquery" | |
}) | |
], | |
resolve: { | |
extensions: ['', '.js'] | |
} | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment