2015-12-27 09:02:57 +08:00
|
|
|
var path = require('path')
|
2015-11-19 04:01:05 +08:00
|
|
|
var webpack = require('webpack')
|
2015-05-11 01:19:55 +08:00
|
|
|
|
|
|
|
module.exports = {
|
2015-11-19 04:01:05 +08:00
|
|
|
entry: './test/unit/specs/index.js',
|
2015-05-11 01:19:55 +08:00
|
|
|
output: {
|
2015-12-27 09:02:57 +08:00
|
|
|
path: path.resolve(__dirname, '../test/unit'),
|
2015-05-11 01:19:55 +08:00
|
|
|
filename: 'specs.js'
|
|
|
|
},
|
2015-12-27 09:02:57 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
src: path.resolve(__dirname, '../src')
|
|
|
|
}
|
|
|
|
},
|
2015-11-19 04:01:05 +08:00
|
|
|
module: {
|
|
|
|
loaders: [
|
2015-12-27 09:02:57 +08:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel',
|
2016-04-17 12:16:27 +08:00
|
|
|
// NOTE: use absolute path to make sure
|
|
|
|
// running tests is OK even if it is in node_modules of other project
|
|
|
|
exclude: [
|
|
|
|
path.resolve(__dirname, '../test/unit'),
|
|
|
|
path.resolve(__dirname, '../node_modules')
|
|
|
|
]
|
2015-12-27 09:02:57 +08:00
|
|
|
}
|
2015-11-19 04:01:05 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
babel: {
|
2015-12-27 09:02:57 +08:00
|
|
|
loose: 'all',
|
|
|
|
optional: ['runtime']
|
2015-11-19 04:01:05 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
NODE_ENV: '"development"'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
devServer: {
|
2015-12-27 09:02:57 +08:00
|
|
|
contentBase: './test/unit',
|
|
|
|
noInfo: true
|
2015-11-19 04:01:05 +08:00
|
|
|
},
|
2016-03-01 02:05:44 +08:00
|
|
|
devtool: 'source-map'
|
2015-07-02 20:59:11 +08:00
|
|
|
}
|