1.0.2 • Published 9 months ago

mk-package v1.0.2

Weekly downloads
4
License
BSD-2-Clause
Repository
github
Last release
9 months ago

mk-package

copy package.json into dist directory for npm publish

npm Package Version

This allows the library consumer to import required files instead of loading the whole library easily.

main and types are auto updated if index.js and index.d.ts exists. Otherwise, the fields will be left blank.

Example library with moved package.json

import { aFunc } from 'a-lib/aModule'

Example library without moved package.json

import { aFunc } from 'a-lib/dist/aModule'

Setup Example

You can use mk-package in last step of build pipeline or in the postbuild hook, then run npm publish inside the dist directory

package.json:

{
  "scripts": {
    "build": "tsc && mk-package",
    "publish": "npm run build && cd dist && npm publish"
  },
  "devDependencies": {
    "mk-package": "^1.0.0"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "outDir": "dist"
  },
  "include": [
    "src/**/*.ts"
  ]
}

Details see ./example

1.0.2

9 months ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago