1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00
OpenSTF/lib/roles/webpack-config.js
2014-02-18 17:07:56 +09:00

49 lines
1.3 KiB
JavaScript

var webpackMiddleware = require('webpack-dev-middleware')
var webpack = require('webpack')
var pathutil = require('../util/pathutil')
module.exports = webpackMiddleware(webpack({
cache: true,
debug: true,
devtool: 'eval-source-map',
entry: pathutil.resource('app') + '/app.js',
output: {
path: '/static/build/',
filename: 'bundle.js'
},
resolve: {
modulesDirectories: [pathutil.resource('lib'), 'web_modules', './../../node_modules'],
alias: {
'socket.io': 'socket.io-client/dist/socket.io'
}
},
module: {
loaders: [
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.jade/, loader: 'template-html-loader' },
{ test: /angular\.js/, loader: 'exports?angular'},
{ test: /angular-route\.js/, loader: 'imports?angular=angular'}
],
noParse: [
pathutil.resource('lib')
]
},
plugins: [
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
),
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main'])
)
//new webpack.optimize.UglifyJsPlugin()
]
}), {
noInfo: false,
quiet: false,
lazy: false,
publicPath: '/static/build/',
stats: {
colors: true
}
})