-
Notifications
You must be signed in to change notification settings - Fork 34
/
reskript.config.ts
61 lines (59 loc) · 1.86 KB
/
reskript.config.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
import path from 'path';
import {configure} from '@reskript/settings';
import ExtraScriptPlugin from '@reskript/webpack-plugin-extra-script';
import qiankun from '@reskript/plugin-qiankun';
const EXTERNAL_NONE = 'https://code.bdstatic.com/npm/none@1.0.0/dist/none.min.js';
export default configure(
'webpack',
{
featureMatrix: {
stable: {
batch: false,
},
insiders: {
batch: true,
},
dev: {
batch: true,
},
},
build: {
appTitle: 'TodoMVC - reSKRipt',
favicon: path.join(__dirname, 'favicon.ico'),
uses: ['antd', 'styled-components', 'tailwind'],
script: {
polyfill: false,
},
finalize: webpackConfig => {
webpackConfig.plugins!.push(new ExtraScriptPlugin({async: true, src: EXTERNAL_NONE}, {prepend: true}));
webpackConfig.optimization!.splitChunks = {
cacheGroups: {
vendors: {
chunks: 'all',
enforce: true,
test: /node_modules/,
},
},
};
return webpackConfig;
},
inspect: {
duplicatePackages: ['warn', {excludes: ['tslib', 'immer', 'color-name', 'is-lite', 'tree-changes']}],
htmlImportable: 'error',
},
},
devServer: {
port: 8989,
https: {
client: true,
serverOptions: {
key: './localhost-key.pem',
cert: './localhost.pem',
},
},
},
plugins: [
qiankun('TodoMVC'),
],
}
);