Created
May 31, 2015 02:37
-
-
Save curiouslychase/63a1945271683baf4bad to your computer and use it in GitHub Desktop.
Sample webpack config
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
var path = require('path'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var webpack = require('webpack'); | |
module.exports = { | |
resolve: { | |
modulesDirectories: ['node_modules', 'sass'], | |
extensions: ['', '.json', '.jsx', '.js'] | |
}, | |
entry: { | |
app: './src/js/entry.js' | |
}, | |
output: { | |
path: __dirname + '/dist', | |
filename: '/js/bundle.js' | |
}, | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
React: 'react', | |
}), | |
new HtmlWebpackPlugin({ template: 'src/index.html' }), | |
new ExtractTextPlugin("css/[name].css"), | |
], | |
module: { | |
loaders: [ | |
{ test: /\.(?:jsx|js)$/, loader: 'jsx-loader?insertPragma=React.DOM&harmony' }, | |
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css-loader?sourceMap!sass?sourceMap')}, | |
{ test: /\.json$/, loader: 'json-loader' } | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment