1.0.1 • Published 10 months ago
tscb v1.0.1
tscb
A lightweight TypeScript packaging library that solves the issue of tsconfig not being able to output both cjs and esm files simultaneously.
Install
npm install tscb
Usage
tscb
will read the configuration from tscb.config.js
or package.json
, and any new configuration will overwrite the settings in the project's tsconfig.json
.
// package.json
{
"tscb": [
{
"compilerOptions": {
"module": "es2015",
"outDir": "dist",
"declaration": true
}
},
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/cjs"
},
"include": ["lib"]
}
]
}
// tscb.config.js
module.exports = [
{
compilerOptions: {
module: 'es2015',
outDir: 'dist',
declaration: true,
},
},
{
compilerOptions: {
module: 'commonjs',
outDir: 'dist/cjs',
},
include: ['lib'],
},
]
Please note, if your project is set to "type": "module"
, you need to change the configuration file suffix to cjs - tscb.config.cjs
.
Run the tscb
command
tscb
or
npx tscb
Command Line Arguments
tscb [--config /path/to/config] [--project /path/to/tsconfig]
API
import { tscb } from 'tscb'
tscb({
compilerOptions: {
module: 'commonjs',
outDir: 'dist/cjs',
},
include: ['lib'],
})
1.0.1
10 months ago
0.0.0-temp.0
10 months ago
0.0.0-temp.3
10 months ago
0.0.0-temp.d8f26eab4a7d8b6e
10 months ago
0.0.0
10 months ago
0.0.0-temp.4
10 months ago
0.0.0-temp.1
10 months ago
0.0.0-temp.2
10 months ago
0.0.2
3 years ago
0.0.1
3 years ago
1.0.0
3 years ago