Skip to content

Instantly share code, notes, and snippets.

@isnifer
Created September 6, 2015 10:16
Show Gist options
  • Save isnifer/b0b720107ae106347e2a to your computer and use it in GitHub Desktop.
Save isnifer/b0b720107ae106347e2a to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
var NyanProgressPlugin = require('nyan-progress-webpack-plugin');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./static/jsx/app.js'
],
output: {
filename: 'app.js',
path: path.join(process.cwd(), 'static/js'),
pathInfo: true,
publicPath: 'http://127.0.0.1:8080/static/js'
},
module: {
loaders: [
{
test: /\.jsx?/,
include: path.join(__dirname, 'static'),
exclude: /node_modules/,
loaders: ['react-hot', 'babel?optional[]=runtime&stage=0&cacheDirectory']
},
{
test: /\.less$/,
include: path.join(__dirname, 'static/less'),
loader: 'style!css!autoprefixer?{browsers:["last 2 version", "Opera 12.1", "ie >= 9"]}!less'
},
{
test: /\.(eot|woff|ttf|svg|png|jpg)/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.less', '.css', '.jpg', '.png', '.svg']
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
new NyanProgressPlugin()
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment