1.0.0 • Published 2 years ago

@candy_myl/rq_utils v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

项目备注

开发一个规范的 npm 包

下载 rollup

    npm install -g rollup

为什么是rollup

如果你将项目拆分成小的单独文件中,这样开发软件通常会很简单,
因为这通常会消除无法预知的相互影响(remove unexpected interaction),
以及显著降低了所要解决的问题的复杂度(complexity of the problem),
并且可以在项目最初时,就简洁地编写小的项目(不一定是标准答案)。
不幸的是,JavaScript 以往并没有将此功能作为语言的核心功能。

rollup.config.js

// rollup.config.js
export default {
  // 核心选项
  input,     // 必须
  external,
  plugins,

  // 额外选项
  onwarn,

  // danger zone
  acorn,
  context,
  moduleContext,
  legacy,

  output: {  // 必须 (如果要输出多个,可以是一个数组)
    // 核心选项
    file,    // 必须
    format,  // 必须
    name,
    globals,

    // 额外选项
    paths,
    banner,
    footer,
    intro,
    outro,
    sourcemap,
    sourcemapFile,
    interop,

    // 高危选项
    exports,
    amd,
    indent,
    strict
  },
}
    默认使用rollup.config.js
    $ rollup --config
    或者, 使用自定义的配置文件,这里使用my.config.js作为配置文件
    $ rollup --config my.config.js

"x": "npm --no-git-tag-version version major", "y": "npm --no-git-tag-version version minor", "z": "npm --no-git-tag-version version patch",