-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.test.js
41 lines (39 loc) · 1.38 KB
/
webpack.test.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
const path = require('path');
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const commonWebpackConfig = require('./webpack.commons.js');
const chaiPath = path.resolve(__dirname, 'node_modules', 'chai/chai.js');
const lodashPath = path.resolve(__dirname, 'node_modules', 'lodash', 'dist', 'lodash.js');
const i18nLoaderMockPath = path.resolve(__dirname, 'test', 'config', 'mocks', 'i18n-loader.js');
module.exports = merge(commonWebpackConfig, {
mode: 'development',
entry: './src/index.test.js',
devtool: 'source-map',
output: {
filename: 'bundle-test.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new webpack.NormalModuleReplacementPlugin(
/node_modules\/esn-frontend-common-libs\/src\/frontend\/js\/modules\/i18n\/i18n-loader.service.js/,
i18nLoaderMockPath
),
new webpack.ProvidePlugin({
chai: chaiPath,
_: lodashPath
})
],
module: {
rules: [
{
test: /\.run.js$/,
loader: 'ignore-loader',
include: [
path.resolve(__dirname, 'node_modules/esn-frontend-common-libs/src/frontend/js/modules/i18n/i18n.run.js'),
path.resolve(__dirname, 'node_modules/esn-frontend-common-libs/src/frontend/js/modules/datetime/datetime.run.js'),
path.resolve(__dirname, 'src/linagora.esn.contact/app/search/search.run.js')
]
}
]
}
});