forked from coldi/r3f-game-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.apprc.js
72 lines (70 loc) · 2.49 KB
/
.apprc.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
63
64
65
66
67
68
69
70
71
72
const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
module.exports = {
presets: ['typescript', 'react'],
addons: config => ({
eslint: {
rules: {
'no-alert': 'off',
'no-unused-expressions': 'off',
'no-param-reassign': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-use-before-define': 'off', // using ts rule instead
'no-continue': 'off',
'no-plusplus': 'off',
'no-bitwise': 'off',
'no-debugger': 'warn',
'import/order': 'warn',
'import/prefer-default-export': 'off',
'react/destructuring-assignment': 'off',
'react/no-array-index-key': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-namespace': 'off',
},
},
babel: {
presets: (presets = []) => [...presets, '@emotion/babel-preset-css-prop'],
plugins: (plugins = []) => {
plugins.push('@babel/plugin-proposal-optional-chaining');
plugins.push('@babel/plugin-proposal-nullish-coalescing-operator');
if (config.options.devMode) {
plugins.push('react-refresh/babel');
}
return plugins;
},
},
typescript: {
compilerOptions: {
skipLibCheck: true,
downlevelIteration: true,
},
},
}),
runners: config => ({
webpack: {
resolve: {
alias: {
'react-dom': 'react-dom',
},
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: { keep_fnames: true },
}),
],
},
plugins: (plugins = []) => {
if (config.options.devMode) {
plugins.push(new ReactRefreshPlugin({ disableRefreshCheck: true }));
}
return plugins;
},
},
}),
};