1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00
OpenSTF/lib/middleware/webpack.js
2014-02-25 14:13:20 +09:00

59 lines
1.6 KiB
JavaScript

var webpackMiddleware = require('webpack-dev-middleware')
var webpack = require('webpack')
var pathutil = require('../util/pathutil')
var webpackOptions = {
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: /\.html/, loader: '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({mangle: false})
]
}
module.exports = webpackMiddleware(webpack(webpackOptions), {
noInfo: false,
quiet: false,
lazy: false,
publicPath: '/static/build/',
stats: {
colors: true
}
})