2015-10-01 11:16:11 +08:00
|
|
|
var webpack = require("webpack");
|
|
|
|
var I18nPlugin = require("./frontend_build/i18nPlugin");
|
|
|
|
var ClientAppsPlugin = require("./frontend_build/clientAppPlugin");
|
|
|
|
var CompiledReferencePlugin = require("./frontend_build/CompiledReferencePlugin");
|
|
|
|
var ShimmedAmdPlugin = require("./frontend_build/shimmedAmdPlugin");
|
|
|
|
|
|
|
|
var baseWebpackConfig = require("./frontend_build/baseWebpackConfig");
|
|
|
|
var testWebpackConfig = baseWebpackConfig;
|
|
|
|
|
2015-12-11 07:17:55 +08:00
|
|
|
// the ember specs don't play nice with the rest,
|
|
|
|
// so we run them in totally seperate bundles
|
|
|
|
if(process.env.WEBPACK_TEST_BUNDLE == 'ember'){
|
|
|
|
testWebpackConfig.entry = {
|
|
|
|
'WebpackedEmberSpecs': "./spec/javascripts/webpack_ember_spec_index.js"
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
testWebpackConfig.entry = {
|
|
|
|
'WebpackedSpecs': "./spec/javascripts/webpack_spec_index.js"
|
|
|
|
}
|
2015-10-01 11:16:11 +08:00
|
|
|
}
|
2015-12-11 07:17:55 +08:00
|
|
|
|
2015-10-01 11:16:11 +08:00
|
|
|
testWebpackConfig.devtool = undefined;
|
|
|
|
testWebpackConfig.output.path = __dirname + '/spec/javascripts/webpack';
|
2015-10-30 04:01:47 +08:00
|
|
|
testWebpackConfig.output.pathinfo = true;
|
2015-10-01 11:16:11 +08:00
|
|
|
testWebpackConfig.output.filename = "[name].bundle.test.js";
|
|
|
|
testWebpackConfig.plugins = [
|
|
|
|
new I18nPlugin(),
|
|
|
|
new ShimmedAmdPlugin(),
|
|
|
|
new ClientAppsPlugin(),
|
2015-10-30 04:01:47 +08:00
|
|
|
new CompiledReferencePlugin(),
|
|
|
|
new webpack.IgnorePlugin(/\.md$/),
|
|
|
|
new webpack.IgnorePlugin(/(CHANGELOG|LICENSE|README)$/),
|
|
|
|
new webpack.IgnorePlugin(/package.json/)
|
2015-10-01 11:16:11 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
testWebpackConfig.resolve.alias.qunit = "qunitjs/qunit/qunit.js";
|
2015-12-09 05:41:14 +08:00
|
|
|
testWebpackConfig.resolve.root.push(__dirname + '/spec/coffeescripts');
|
|
|
|
testWebpackConfig.resolve.root.push(__dirname + '/spec/javascripts/support');
|
2015-12-11 07:17:55 +08:00
|
|
|
|
2015-10-01 11:16:11 +08:00
|
|
|
testWebpackConfig.module.loaders.push({
|
|
|
|
test: /\/spec\/coffeescripts\//,
|
|
|
|
loaders: ["qunitDependencyLoader"]
|
|
|
|
});
|
2015-12-11 07:17:55 +08:00
|
|
|
|
|
|
|
testWebpackConfig.module.loaders.push({
|
|
|
|
test: /\/ember\/.*\/tests\//,
|
|
|
|
loaders: ["qunitDependencyLoader"]
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2015-10-30 04:01:47 +08:00
|
|
|
testWebpackConfig.module.noParse = [
|
|
|
|
/\/sinon-1.17.2.js/
|
|
|
|
]
|
2015-10-01 11:16:11 +08:00
|
|
|
|
|
|
|
module.exports = testWebpackConfig;
|