fix: browsers compatibility of dataLoader (#6522)

This commit is contained in:
ClarkXia 2023-09-11 11:24:19 +08:00 committed by GitHub
parent a04cc00242
commit cec448c36a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'@ice/app': patch
---
fix: browsers compatibility of dataLoader

View File

@ -38,7 +38,8 @@ type ServerCompilerBuildOptions = Pick<
'plugins' |
'logLevel' |
'sourcemap' |
'metafile'
'metafile' |
'supported'
>;
export type ServerBuildResult =

View File

@ -55,6 +55,10 @@ export default class DataLoaderPlugin {
target: 'es6', // should not set to esnext, https://github.com/alibaba/ice/issues/5830
format: 'iife',
entryPoints: [filePath],
supported: {
// Do not wrap arrow function when format as IIFE.
arrow: false,
},
write: false,
logLevel: 'silent', // The main server compile process will log it.
},