forked from fullcalendar/fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.tests.js
62 lines (57 loc) · 1.64 KB
/
webpack.tests.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
62
// HACK for ProvidePlugin
require('@yarnpkg/pnpify').patchFs()
const path = require('path')
const webpack = require('webpack')
const MomentLocalesPlugin = require('moment-locales-webpack-plugin')
const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin')
const { publicPackageStructs } = require('./scripts/lib/package-index')
const { buildAliasMap } = require('./scripts/lib/new-webpack')
module.exports = (env) => {
let fromSrc = env && env.PACKAGES_FROM_SOURCE
return {
mode: 'development',
devtool: 'source-map',
entry: './tmp/tests/index.js',
output: {
filename: 'all.js',
path: path.join(__dirname, 'tmp/tests')
},
resolve: {
extensions: [ '.ts', '.tsx', '.js' ],
alias: fromSrc ? buildAliasMap(publicPackageStructs) : {}
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{ loader: 'ts-loader', options: { transpileOnly: true } }
]
},
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
{ loader: 'postcss-loader', options: { sourceMap: true } }
]
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
new MomentLocalesPlugin({
localesToKeep: [ 'es' ], // a test relies on this
}),
new MomentTimezoneDataPlugin({
matchZones: [ 'Europe/Moscow' ] // a test relies on this
})
],
stats: {
warningsFilter: /export .* was not found in/
}
}
}