Skip to content

Instantly share code, notes, and snippets.

@blakef
Created May 21, 2016 16:48
Show Gist options
  • Save blakef/6c68f9ec89000ca22c5bab37c7ac91b6 to your computer and use it in GitHub Desktop.
Save blakef/6c68f9ec89000ca22c5bab37c7ac91b6 to your computer and use it in GitHub Desktop.
Webpack configuration trubs.
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
module.exports = {
context: __dirname,
entry: {
'app': [
'./src/javascript/site.js',
]
},
output: {
path: './dist',
filename: '[name].js'
},
plugins: [
new ExtractTextPlugin('[name].css')
],
module: {
loaders: [
{ test: /\.json$/, loader: 'json' },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css!sass') },
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url?limit=10000&minetype=application/font-woff"
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file?prefix=fonts/"
},
{
test: /\.(gif|jp|png|svg)$/,
loader: 'file?prefix=images/'
},
]
},
resolve: {
extensions: ['', '.js', '.scss'],
root: [path.join(__dirname, 'toolkit')]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment