-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
webpack.config.e2e.ts
70 lines (68 loc) · 1.92 KB
/
webpack.config.e2e.ts
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
63
64
65
66
67
68
69
70
import CopyWebpackPlugin from 'copy-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import { webpack as lernaAliases } from '../lernaAliasNorthstar';
import webpack from 'webpack';
import getDefaultEnvironmentVars from './getDefaultEnvironmentVars';
import config from '../config';
const { paths } = config;
const webpackConfig: webpack.Configuration = {
name: 'client',
target: 'web',
// CI should use production builds to improve perf of loading pages
mode: 'production',
entry: {
app: paths.e2eSrc('app'),
},
output: {
filename: `[name].js`,
path: paths.e2eDist(),
},
// CI should not use sourcemaps, but it's useful for local debugging
devtool: process.env.CI ? false : config.compiler_devtool,
node: {
global: true,
},
module: {
noParse: [
/anchor-js/,
/prettier\/parser-typescript/, // prettier issue, should be solved after upgrade prettier to version 2 https://github.com/prettier/prettier/issues/6903
],
rules: [
{
test: /\.(js|ts|tsx)$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
cacheDirectory: true,
},
},
],
},
plugins: [
new webpack.DefinePlugin(getDefaultEnvironmentVars(true)),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: paths.e2e('tsconfig.json'),
},
}),
new CopyWebpackPlugin({
patterns: [
{
from: paths.e2eSrc('index.html'),
to: paths.e2eDist(),
},
],
}),
],
resolve: {
fallback: {
path: require.resolve('path-browserify'),
},
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: lernaAliases(),
},
performance: {
hints: false, // to (temporarily) disable "WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit")
},
};
export default webpackConfig;