Skip to content

Instantly share code, notes, and snippets.

@terebentina
Created February 24, 2015 14:17
Show Gist options
  • Save terebentina/df5344733d928a04c6a2 to your computer and use it in GitHub Desktop.
Save terebentina/df5344733d928a04c6a2 to your computer and use it in GitHub Desktop.
"use strict";
var path = require('path' ),
webpack = require('webpack')
;
var _DEV_ = true;
var config = {
entry: {
app: path.resolve(__dirname, 'client/app/index.jsx'),
vendors: ['react', 'jquery']
},
output: {
path: path.resolve(__dirname, 'client/js'),
filename: '[name].js',
publicPath: '/assets/',
},
module: {
noParse: [],
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ['react-hot', 'babel']},
{ test: /\.json$/, loader: 'json'},
{ test: /\.css$/, loader: 'style!css'},
{ test: /(\.scss)|(\.sass)$/, loader: 'style!css!sass'},
]
},
target: 'web',
devtool: _DEV_ ? '#inline-source-map' : false,
debug: _DEV_,
cache: _DEV_,
stats: {
colors: true,
reasons: _DEV_
},
resolve: {
root: path.join(__dirname, 'client', 'app'),
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx'],
alias: {},
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
plugins: [
//new webpack.optimize.OccurenceOrderPlugin(),
//new webpack.PrefetchPlugin('react'),
//new webpack.PrefetchPlugin('react/lib/ReactComponentBrowserEnvironment'),
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment