JSPM

@joker.front/cli-plugin-legacy

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q12975F
  • License MIT

joker.front/cli 兼容性转换插件

Package Exports

  • @joker.front/cli-plugin-legacy
  • @joker.front/cli-plugin-legacy/dist/bundle.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@joker.front/cli-plugin-legacy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Joker.front/cli 浏览器兼容插件

Joker.front/cli 的默认浏览器支持基线是原生 ESM、原生 ESM 动态导入和 import.meta。此插件为在构建生产环境时提供不支持这些功能的旧版浏览器的支持。

默认情况下,此插件将: 为最终包中的每个块生成相应的旧版块,使用 @babel/preset-env 转换并作为 SystemJS 模块发出(仍然支持代码分割!)。 生成一个包含 SystemJS 运行时和通过指定浏览器目标和实际使用情况确定的必要 polyfills 的 polyfills 块。

如何使用

此插件为@joker.front/cli的扩展插件,需要在CLI配置文件中进行插件配置(例如:joker.config.js):

import legacy from "@joker.front/cli-plugin-legacy";

export default {
    plugins: [
        legacy({
            //默认为“-legacy”
            legacyName: "-legacy",
            targets: ["chrome 80", "ie >= 10"],
            modernPolyfills: ["es.promise.finally"]
        })
    ]
};

文档

官网

帮助文档