slush-laima
Version:
The generator of Laima https://github.com/indigofeather/laima
84 lines (74 loc) • 2.36 kB
JavaScript
var path = require('path');
var webpack = require("webpack");
module.exports = function(config) {
config.set({
files: [
'test/index.js'
],
// frameworks to use
frameworks: ['mocha', 'sinon'],
preprocessors: {
'test/index.js': ['webpack']
},
reporters: ['mocha', 'coverage'],
coverageReporter: {
dir: 'build/coverage/',
reporters: [
{type: 'html', subdir: 'report-html'},
{type: 'text-summary'}
]
},
singleRun: false,
webpack: {
// webpack configuration
module: {
loaders: [
{
test: /\.js$/,
loader: ['babel-loader'],
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ['react', 'es2015', 'stage-0'],
plugins: ['add-module-exports']
}
},
{test: /\.json$/, loader: 'json'}
],
preLoaders: [{
test: /\.js$/,
exclude: /(test|node_modules)/,
loader: 'isparta-instrumenter',
query: {
babel: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['add-module-exports']
}
}
}]
},
resolve: {
alias: {
'actions': path.resolve(__dirname, 'src', 'js', 'actions'),
'api': path.resolve(__dirname, 'src', 'js', 'api'),
'components': path.resolve(__dirname, 'src', 'js', 'components'),
'config': path.resolve(__dirname, 'src', 'js', 'config'),
'containers': path.resolve(__dirname, 'src', 'js', 'containers'),
'middleware': path.resolve(__dirname, 'src', 'js', 'middleware'),
'mixins': path.resolve(__dirname, 'src', 'js', 'mixins'),
'reducers': path.resolve(__dirname, 'src', 'js', 'reducers'),
'store': path.resolve(__dirname, 'src', 'js', 'store'),
'utils': path.resolve(__dirname, 'src', 'js', 'utils'),
'locales': path.resolve(__dirname, 'src', 'locales'),
'libs': path.resolve(__dirname, 'src', 'js', 'libs'),
'business': path.resolve(__dirname, 'src', 'js', 'business')
}
}
},
webpackMiddleware: {
// webpack-dev-middleware configuration
noInfo: true
},
browsers: ['PhantomJS']
});
};