|
|
@@ -43,11 +43,28 @@ module.exports = function (config) {
|
|
|
frameworks: ['requirejs', 'mocha', 'chai-sinon'],
|
|
|
// Configure webpack in the tests
|
|
|
webpack: {
|
|
|
+ module: {
|
|
|
+ rules: [{
|
|
|
+ // Pass application JS files through babel-loader, compiling to ES5
|
|
|
+ test: /\.js$/,
|
|
|
+ // Only compile application files (dependencies are in ES5 already)
|
|
|
+ exclude: /node_modules/,
|
|
|
+ use: [{
|
|
|
+ loader: 'babel-loader',
|
|
|
+ options: {
|
|
|
+ // Configure babel-loader to cache compiled output so that subsequent
|
|
|
+ // compile runs are much faster
|
|
|
+ cacheDirectory: true
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ },
|
|
|
resolve: {
|
|
|
+ // Alias common directories in import pathnames to cut down on the
|
|
|
+ // amount of ../../ etc
|
|
|
alias: {
|
|
|
- // Alias Src in import pathnames to public/es
|
|
|
- // Cuts down on the amount of ../../ etc
|
|
|
- Src: path.join(__dirname, 'public/es/')
|
|
|
+ Src: path.join(__dirname, 'public/es/'),
|
|
|
+ Modules: path.join(__dirname, 'modules')
|
|
|
}
|
|
|
}
|
|
|
},
|