@ babel / preset-env示例 与通天塔7 主要文档: : @ babel / polyfill文档: : 浏览器列表: : # .browserslistrc > 1% in FR // babel.config.js module . exports = { presets : [ [ '@babel/preset-env' , { useBuiltIns : 'entry' , debug : true } ] ] } ; // First line inside your app (App.js for this example) // Not needed with useBuiltIns: 'usage' //import '@babel/polyfill' 发现 指定文件.browserslistrc而不是babel.config.js browsers: [...] :将由Autoprefixer和其他工具重用 useBuiltIns: 'usage
2021-02-01 19:05:58 8KB polyfill babel browserslist babel-preset-env
1
TypeScript + Babel 7 基于Babel 7新功能构建的示例TypeScript项目。 包括React 16,Jest和Enzyme(用于测试)。 由于不再需要使用TypeScript编译器来编译源代码,因此您可以保留现有的Babel管道,而是依靠基于编辑器的类型检查或tsc 。 安装 git clone https://github.com/damassi/babel-7-typescript-example && cd babel-7-typescript-example yarn install yarn start yarn test:watch yarn typecheck 有关使用Webpack的更完整的示例,请参见此-感谢@flobacher。 如果使用VSCode,请确保安装推荐的扩展。 例 // App.tsx import React , { Component } from ' react ' interface Props { name : string } export const App extends Component < Pr
1
babel-preset-njs:NJS的Babel预设-NGINX JavaScript
2021-02-01 14:38:07 8KB nginx babel babel-preset njs
1