Skip to content

Instantly share code, notes, and snippets.

@rcolepeterson
Created April 6, 2016 21:28
Show Gist options
  • Save rcolepeterson/4a00ae8c7bf17d74106091af74b8e7e3 to your computer and use it in GitHub Desktop.
Save rcolepeterson/4a00ae8c7bf17d74106091af74b8e7e3 to your computer and use it in GitHub Desktop.
webpack.config.js
'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