Skip to content

Commit

Permalink
Rewrite webpack config in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Sep 21, 2015
1 parent 1ba0416 commit 4b834a0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 52 deletions.
52 changes: 0 additions & 52 deletions webpack.config.coffee

This file was deleted.

37 changes: 37 additions & 0 deletions webpack.config.js
@@ -0,0 +1,37 @@
var pkg = require('./package.json');
var node_modules = __dirname + '/node_modules';
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var environment = process.env.NODE_ENV;

module.exports = {
cache: true,
resolve: {
extensions: ['', '.jsx', '.cjsx', '.coffee', '.js', '.json', '.styl']
},
context: __dirname,
entry: {
commons: ['./components/commons.styl'],
test: ['webpack/hot/dev-server', './spec/index.jsx']
},
output: {
path: environment === 'production' ? './dist' : './build',
filename: pkg.name + '.[name].js',
publicPath: '/build/'
},
devServer: {
host: '0.0.0.0',
port: 8080,
inline: true
},
module: {
noParse: [node_modules + '/react/dist/*.js'],
loaders: [
{ test: /(\.js|\.jsx)$/, exclude: /(node_modules)/, loader: 'babel?optional=runtime'},
{ test: /\.cjsx$/, loader: 'coffee-jsx-loader'},
{ test: /\.coffee$/, loader: 'coffee-jsx-loader'},
{ test: /\.styl$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader!stylus-loader!')}
]
},
postcss: [require('autoprefixer-core')],
plugins: [new ExtractTextPlugin(pkg.name + '.[name].css', {allChunks: false})]
};

0 comments on commit 4b834a0

Please sign in to comment.