mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Move webpack-config.js to the middleware folder.
This commit is contained in:
parent
13361c5264
commit
f24e777961
2 changed files with 3 additions and 4 deletions
59
lib/middleware/webpack.js
Normal file
59
lib/middleware/webpack.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
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
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue