Publish your project flattened. No more dist
in require('project/dist/Options')
.
ℹ️ This is a pure ESM module.
Run yarn add publish-flat
or npm i publish-flat
.
Here is what it does:
- Copies your dist files together with the other release files into a temporary directory
- Aligns your
package.json
to work with the flattened structure - Publishes your project from the temporary directory (optional)
.
├── dist
│ ├── index.d.ts
│ ├── index.js
│ ├── index.js.map
│ ├── Options.d.ts
│ ├── Options.js
│ └── Options.js.map
└── package.json
import {Options} from 'project/dist/Options';
.
├── index.d.ts
├── index.js
├── index.js.map
├── Options.d.ts
├── Options.js
├── Options.js.map
└── package.json
import {Options} from 'project/Options';
yarn add publish-flat
Usage: publish-flat [options] [dir]
Publish your project without the dist directory
Options:
-V, --version output the version number
-y, --yarn Use yarn for publishing (default: false)
-f, --flatten <dir> Which directory to flatten (default: "dist")
-o, --output <dir> Set the output directory (default: temp directory)
-p, --publish Publish (default: false)
-h, --help output usage information
See cli.ts
.