2015-06-14 11:48:44 +03:00
' use strict '
2015-06-11 06:29:55 +03:00
2015-06-13 14:18:31 +03:00
pkg = require ' ./package.json '
node_modules = __dirname + ' /node_modules '
ExtractTextPlugin = require ( ' extract-text-webpack-plugin ' )
environment = process . env . NODE_ENV
2015-06-11 06:29:55 +03:00
module.exports =
2015-06-14 11:48:44 +03:00
cache : true
2015-09-05 23:30:59 +03:00
resolve : extensions: [ ' ' , ' .jsx ' , ' .cjsx ' , ' .coffee ' , ' .js ' , ' .json ' , ' .styl ' ]
2015-06-14 11:48:44 +03:00
context : __dirname
2015-06-11 06:29:55 +03:00
2015-06-14 11:48:44 +03:00
entry:
2015-06-22 13:13:08 +03:00
commons : [ ' ./components/commons.styl ' ]
2015-06-14 11:48:44 +03:00
test : [ ' webpack/hot/dev-server ' , ' ./spec/index.cjsx ' ]
# test : ['webpack/hot/dev-server', './spec/index.cjsx']
2015-06-11 06:29:55 +03:00
2015-06-14 11:48:44 +03:00
output:
path : if environment is ' production ' then ' ./dist ' else ' ./build '
filename : pkg . name + ' .[name].js '
publicPath : ' /build/ '
2015-06-11 06:29:55 +03:00
devServer:
2015-06-14 11:48:44 +03:00
# contentBase : './build'
2015-07-19 22:51:15 +03:00
host : ' 0.0.0.0 '
2015-06-13 14:18:31 +03:00
port : 8080
2015-06-11 06:29:55 +03:00
# colors : true
# progress : true
# noInfo : false
# hot : true
inline : true
2015-06-14 11:48:44 +03:00
module:
noParse : [ node_modules + ' /react/dist/*.js ' ]
2015-06-11 06:29:55 +03:00
2015-06-14 11:48:44 +03:00
loaders: [
2015-09-06 20:29:51 +03:00
test : /(\.js|\.jsx)$/ , exclude : /(node_modules)/ , loader: ' babel?optional=runtime '
2015-09-05 02:11:07 +03:00
,
2015-06-14 11:48:44 +03:00
test : /\.cjsx$/ , loader: ' coffee-jsx-loader '
2015-06-11 06:29:55 +03:00
,
2015-06-14 11:48:44 +03:00
test : /\.coffee$/ , loader: ' coffee-jsx-loader '
2015-06-11 06:29:55 +03:00
,
2015-07-20 02:41:13 +03:00
test : /\.styl$/ , loader: ExtractTextPlugin . extract ( ' style-loader ' , ' css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader!stylus-loader! ' )
2015-06-11 06:29:55 +03:00
]
2015-06-13 14:18:31 +03:00
2015-07-20 02:41:13 +03:00
postcss: [
require ( ' autoprefixer-core ' )
] ,
2015-06-13 14:18:31 +03:00
plugins: [
2015-06-14 11:48:44 +03:00
new ExtractTextPlugin pkg . name + ' .[name].css ' , allChunks: false
2015-06-13 14:18:31 +03:00
]