Skip to content

Commit e3e826f

Browse files
committed
extract configs
1 parent e6cb8f2 commit e3e826f

File tree

4 files changed

+123
-112
lines changed

4 files changed

+123
-112
lines changed

package-lock.json

Lines changed: 69 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core-js-builder/config.mjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,52 @@ export const banner = '/**\n' +
88
' * source: https://github.com/zloirock/core-js\n' +
99
' */';
1010
/* eslint-enable prefer-template -- for better formatting */
11+
12+
export function getRolldownOptions(input, output) {
13+
return {
14+
input,
15+
platform: 'neutral',
16+
treeshake: false,
17+
output: {
18+
externalLiveBindings: false,
19+
format: 'iife',
20+
file: output,
21+
keepNames: true,
22+
minifyInternalExports: true,
23+
},
24+
};
25+
}
26+
27+
export const ModernSyntax = [
28+
'arrow-functions',
29+
'shorthand-properties',
30+
];
31+
32+
export const MinifyOptions = {
33+
minify: true,
34+
jsc: {
35+
minify: {
36+
compress: {
37+
arrows: false,
38+
ecma: 5,
39+
hoist_funs: true,
40+
keep_fnames: true,
41+
pure_getters: true,
42+
reduce_funcs: true,
43+
// document.all detection case
44+
typeofs: false,
45+
unsafe_proto: true,
46+
unsafe_undefined: true,
47+
},
48+
mangle: {
49+
keep_fnames: true,
50+
safari10: true,
51+
toplevel: true,
52+
},
53+
format: {
54+
comments: false,
55+
ecma: 5,
56+
},
57+
},
58+
},
59+
};

0 commit comments

Comments
 (0)