Created
May 21, 2016 16:48
-
-
Save blakef/6c68f9ec89000ca22c5bab37c7ac91b6 to your computer and use it in GitHub Desktop.
Webpack configuration trubs.
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
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