1.0.6 • Published 4 years ago

@jarzzzi/nidavel v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

nidavel 制造兵器的星球

特性:

  • 支持 cjs、umd、esm
  • 默认支持 ts
  • 默认支持 eslint。需要手动添加 .eslintrc.json 文件
  • 默认 bable + preset-typeScript 进行编译
  • 集成 babel react 优化插件和 es next 实验性插件
  • 默认 src/index.ts 为入口。 dist 为输出目录
  • 默认不进行代码压缩
  • 默认打包不会增加 polyfill,建议在应用打包中增加 polyfill,以避免重复 polyfill

使用:

import configRollup from 'nidavel'

// simple
export default configRollup(options)

// overrides
export defualt configRollup(options, (config) => {
  return {
    ...config,
    ...{
      // overrides
    }
  }
})

配置:

type Target = 'cjs' | 'esm' | 'umd'

interface Options {
  target: Target[],
  globals?: {[key: string]: string}, // 外部引入的依赖
  input?: string, // 入口,default src/index.ts
  external?: string[], // 排除打包的库
  alias?: { [key: string]: string },
  isTypescript?: boolean, // default true
  minify?: boolean, // default false
  filesize?: boolean, // default true
  eslintOptions?: any,
  replaceOptions?: any
}

interface OptionsOverrideCallback {
  (config: RollupOptions): RollupOptions
}
@babel/core@babel/plugin-proposal-class-properties@babel/plugin-proposal-decorators@babel/plugin-proposal-do-expressions@babel/plugin-proposal-export-default-from@babel/plugin-proposal-export-namespace-from@babel/plugin-proposal-nullish-coalescing-operator@babel/plugin-proposal-optional-chaining@babel/plugin-syntax-jsx@babel/plugin-transform-react-constant-elements@babel/plugin-transform-react-display-name@babel/plugin-transform-react-jsx@babel/plugin-transform-react-jsx-compat@babel/plugin-transform-react-jsx-self@babel/plugin-transform-react-jsx-source@babel/plugin-transform-runtime@babel/preset-env@babel/preset-typescript@rollup/plugin-alias@rollup/plugin-commonjs@rollup/plugin-image@rollup/plugin-json@rollup/plugin-node-resolve@rollup/plugin-replace@rollup/plugin-url@svgr/rollup@types/autoprefixer@types/babel__core@types/node@types/rollup-plugin-json@types/rollup-plugin-node-builtins@types/rollup-plugin-node-globals@types/rollup-plugin-peer-deps-external@types/rollup-plugin-postcss@types/rollup-plugin-url@typescript-eslint/eslint-plugin@typescript-eslint/parserautoprefixerbabel-eslintbabel-plugin-react-requirebabel-preset-react-appcore-jseslinteslint-config-react-appeslint-plugin-flowtypeeslint-plugin-importeslint-plugin-jsx-a11yeslint-plugin-reacteslint-plugin-react-hookslesslodash.camelcasenode-sassrolluprollup-plugin-analyzerrollup-plugin-babelrollup-plugin-clearrollup-plugin-eslintrollup-plugin-filesizerollup-plugin-node-builtinsrollup-plugin-node-globalsrollup-plugin-peer-deps-externalrollup-plugin-postcssrollup-plugin-sourcemapsrollup-plugin-terserrollup-plugin-typescript2typedoctypescript
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago