forked from linagora/esn-frontend-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.js
52 lines (50 loc) · 2.33 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
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const commons = require('./webpack.commons.js');
const momentPath = path.resolve(__dirname, 'node_modules', 'moment', 'moment.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(commons, {
mode: 'development',
entry: './src/index.test.js',
devtool: 'inline-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,
moment: momentPath
})
],
module: {
rules: [
{
test: /\.run.js$/,
loader: 'ignore-loader',
include: [
path.resolve(__dirname, 'node_modules/esn-frontend-common-libs/src/frontend/js/esn/app.js'),
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, 'node_modules/esn-frontend-common-libs/src/frontend/js/modules/user/user.run.js'),
path.resolve(__dirname, 'src/app/app.run.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/app/search/search.run.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/app/configuration/configuration.run.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/app/services/cal-default-value.run.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/app/services/websocket/listener.run.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/event-consultation-app/app.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/event-consultation-app/error.js'),
path.resolve(__dirname, 'src/linagora.esn.calendar/event-consultation-app/error-display/**/*.js')
]
}
]
}
});