@joker.front/cli-plugin-legacy

1.0.2 • Public • Published

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"]
        })
    ]
};

文档

官网

帮助文档

Readme

Keywords

Package Sidebar

Install

npm i @joker.front/cli-plugin-legacy

Homepage

jokers.pub

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

51.9 kB

Total Files

3

Last publish

Collaborators

  • joker.zohar