forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.config.babel.js
61 lines (51 loc) · 1.92 KB
/
webpack.test.config.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
// 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"
}
}
testWebpackConfig.devtool = undefined;
testWebpackConfig.output.path = __dirname + '/spec/javascripts/webpack';
testWebpackConfig.output.pathinfo = true;
testWebpackConfig.output.filename = "[name].bundle.test.js";
testWebpackConfig.plugins = [
new I18nPlugin(),
new ShimmedAmdPlugin(),
new ClientAppsPlugin(),
new CompiledReferencePlugin(),
new webpack.IgnorePlugin(/\.md$/),
new webpack.IgnorePlugin(/(CHANGELOG|LICENSE|README)$/),
new webpack.IgnorePlugin(/package.json/)
];
testWebpackConfig.resolve.alias.qunit = "qunitjs/qunit/qunit.js";
testWebpackConfig.resolve.root.push(__dirname + '/spec/coffeescripts');
testWebpackConfig.resolve.root.push(__dirname + '/spec/javascripts/support');
testWebpackConfig.module.loaders.push({
test: /\/spec\/coffeescripts\//,
loaders: ["qunitDependencyLoader"]
});
testWebpackConfig.module.loaders.push({
test: /\/spec\/javascripts\/jsx\//,
loaders: ["qunitJsxDependencyLoader"]
});
testWebpackConfig.module.loaders.push({
test: /\/ember\/.*\/tests\//,
loaders: ["qunitDependencyLoader"]
});
testWebpackConfig.module.noParse = [
/\/sinon-1.17.2.js/,
/\/axe.js/
]
module.exports = testWebpackConfig;