build.polyfill

breakchange in v3.1.4

polyfill.entryCdn

add in v3.1.5
  • Inject compatibility code CDN script in page header
  • Example: https://unpkg.com/@empjs/[email protected]/dist/es.js
  • Compatibility code repository: To be added

polyfill.mode

add in v3.1.4
  • Inject compatibility code
  • Type: entry | usage | false
  • Default: false
TIP

Recommended to use entry for module federation entry points

polyfill.entry

remove in v3.1.4

Inject compatibility code into entry file

polyfill.usage

remove in v3.1.4

Add compatibility code on demand

polyfill.coreJsFeatures

TIP

Choosing the right core-js compatibility version helps optimize code size

  • Type: full | actual | stable | es
  • Default: stable

polyfill.externalHelpers

  • Externalize @swc/helpers
  • Type: boolean
  • Default: false

polyfill.browserslist

  • Browser compatibility versions
  • Type: string[]
  • Default: ['chrome >= 87', 'edge >= 88', 'firefox >= 78', 'safari >= 14']
emp-config.js
import {defineConfig} from '@empjs/cli'
export default defineConfig(store => {
  return {
    build:{
        mode:'usage',
    }
  }
})