Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample webpack config
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
You can’t perform that action at this time.