Skip to content

Instantly share code, notes, and snippets.

@lamosty
Created October 26, 2015 14:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lamosty/31e343dce5a676f0da6d to your computer and use it in GitHub Desktop.
Save lamosty/31e343dce5a676f0da6d to your computer and use it in GitHub Desktop.
webpack.config.js file from the Lexi WordPress theme: https://github.com/lamosty/lexi/blob/master/webpack.config.js
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.template.html',
inject: true
}),
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin("style.css", {
allChunks: true
})
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
exclude: /node_modules/,
include: __dirname
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
}, {
test: /\.png$/,
loader: "url-loader?limit=100000"
}, {
test: /\.jpg$/,
loader: "file-loader"
}, {
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader'
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment