Skip to content

Instantly share code, notes, and snippets.

@josephcc
Created October 26, 2015 20:57
Show Gist options
  • Select an option

  • Save josephcc/9906562c565e98d9c76e to your computer and use it in GitHub Desktop.

Select an option

Save josephcc/9906562c565e98d9c76e to your computer and use it in GitHub Desktop.
var webpack = require("webpack");
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: {
app: './app/app.jsx',
},
output: {
path: '../dist',
filename: '[name].js'
},
module: {
loaders: [
{
test: /\.jsx$/,
loader: "babel-loader",
include: path.join(__dirname, 'app')
},
{
test: /\.(css)(\?.+)$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{
test: /\.(otf|eot|svg|ttf|woff|woff2)(\?.+)$/,
loader: 'url-loader?limit=8192'
}
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.PrefetchPlugin("react"),
new webpack.PrefetchPlugin("react/lib/ReactComponentBrowserEnvironment"),
new ExtractTextPlugin('../bundle.css')
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment