mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
21 lines
504 B
JavaScript
21 lines
504 B
JavaScript
export function buildSwcOptions(browserslist, config, isJsx, isTs) {
|
|
return {
|
|
env: {
|
|
targets: browserslist,
|
|
mode: 'entry',
|
|
coreJs: '3',
|
|
},
|
|
jsc: {
|
|
parser: {
|
|
syntax: isTs ? 'typescript' : 'ecmascript',
|
|
jsx: isJsx,
|
|
},
|
|
experimental: {
|
|
plugins: [['swc-plugin-vue-jsx', {}]],
|
|
},
|
|
},
|
|
minify: true,
|
|
...config.swcLoader,
|
|
};
|
|
}
|