1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 02:09:32 +02:00
OpenSTF/lib/roles/webpack-config.js
2014-02-19 16:52:26 +09:00

58 lines
No EOL
1.5 KiB
JavaScript

var webpackMiddleware = require('webpack-dev-middleware')
var webpack = require('webpack')
var pathutil = require('../util/pathutil')
var webpackConfig = webpackMiddleware(webpack({
cache: true,
debug: true,
devtool: 'eval',
entry: pathutil.resource('app') + '/app.js',
output: {
path: '/static/build/',
filename: 'bundle.js'
},
resolve: {
modulesDirectories: [
pathutil.resource('lib'),
pathutil.resource('app') + '/components',
'web_modules',
'./../../node_modules'
],
alias: {
'socket.io': 'socket.io-client/dist/socket.io',
'oboe': 'oboe/dist/oboe-browser'
}
},
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'},
{ test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'}
],
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
}
})
module.exports = webpackConfig