New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tarojsx/polyfill

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tarojsx/polyfill

Taro3 runtime polyfill

latest
Source
npmnpm
Version
0.16.0
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Taro3 Polyfill

让 Taro3 运行环境更接近现代浏览器

License npm version npm downloads dependents PRs welcome
Built with :purple_heart: by @Colder and Contributors
:star2: :eyes: :zap: :boom:

当前代码提交频繁,一些特性时有变化。

很多优秀的前端类库都是为现代浏览器而设计的。Taro3 Runtime 为我们提供了基础的 BOM/DOM API,例如 window document navigator。我们需要自己动手在这个基础上打造一个更接近现代浏览器的运行环境。

这里搜集了一些扩展 Taro3 运行环境的 小玩意儿(Polyfill)

特性

  • :electric_plug: 编译时注入。

  • :clapper: 项目中直接使用。

  • :octopus: 自动处理依赖关系。

需求

  • taro 3+

安装

npm i @tarojsx/polyfill

使用

更新 config/index.js 配置如下

const { TaroProvidePlugin } = require('@tarojsx/polyfill/dist/plugins')

const config = {
    mini: {
        webpackChain(chain, webpack) {
            // 注入默认 polyfills (详见下方列表)
            chain
                .plugin('taroProviderPlugin')
                .use(TaroProvidePlugin)

            // 注入更多 polyfills
            // chain
            //     .plugin('taroProviderPlugin')
            //     .use(TaroProvidePlugin, [['default', 'Intl']])
        }
    }
}

Polyfills

默认

更多

支持

欢迎各种形式的支持。至少可以给颗星 :star:

测试步骤

  • 打开微信开发者工具 CLI/HTTP 调用功能,设置 - 安全设置 - 服务端口
  • 导入项目,目录指向当前项目文件夹。
  • 运行 npm run test
  • 如果提示 Failed to launch wechat web devTools,请先退出微信开发者工具。

License

MIT

Keywords

taro

FAQs

Package last updated on 28 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts