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
|
|
|
|
resolve : extensions: ['', '.cjsx', '.coffee', '.js', '.json', '.styl']
|
|
|
|
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'
|
|
|
|
host : 'localhost'
|
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: [
|
|
|
|
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-06-14 11:48:44 +03:00
|
|
|
test : /\.styl$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!stylus-loader!')
|
2015-06-11 06:29:55 +03:00
|
|
|
]
|
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
|
|
|
]
|