0.0.3 • Published 1 year ago

@xunserver/babel-config v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

功能

配置了常见的 babel 配置,包括 polyfill,默认使用项目根目录中的.browserlist 作为 target。

安装

npm i -D @xunserver/babel-config

或者使用 @xunserver/cli 包提供xs add babel 安装

使用

// .babelrc.js
module.exports = {
    presets: [['@xunserver/babel-config', {
        typescript: true,
        typescriptOptions: {}, // @babel/preset-typescript
        envOptions: {} // @babel/preset-env 配置
    }]] // 默认
    presets: [['@xunserver/babel-config/react', {
        typescript: true,
        envOptions: {}, // @babel/preset-env 配置
        reactOptions: {} // @babel/preset-react 配置
    }]] // react
    presets: [[
        '@xunserver/babel-config/vue', {
            typescript: true,
            vueOptions: {}
        }
    ]]
}