stubb
v1.3.0
Published
Stub 'dist' link your project based on package.json during the development
Downloads
28
Maintainers
Readme
stubb
Stub dist
link your project based on package.json
during the development.
Install
npm install --save-dev stubb
Usage
In the 'package.json' of the package in need:
{
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"stub": "stubb"
}
}
Generate folders and files based on the main
, module
, types
and exports
in package.json
.
Default project structure:
|-- package
|-- dist/
|-- index.cjs
|-- index.mjs
|-- index.d.ts
|-- src/
|-- index.ts
|-- package.json
Add entry
in the exports
field to modify the entry file:
{
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"entry": "./test/index.ts"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"stub": "stubb"
}
}
if exposing multiple entry points:
{
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./plugins": {
"types": "./dist/plugins.d.ts",
"import": "./dist/plugins.mjs",
"require": "./dist/plugins.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"stub": "stubb"
}
}