1.0.1 • Published 2 years 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 tscbUsage
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
tscbor
npx tscbCommand 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
2 years ago
0.0.0-temp.0
2 years ago
0.0.0-temp.3
2 years ago
0.0.0-temp.d8f26eab4a7d8b6e
2 years ago
0.0.0
2 years ago
0.0.0-temp.4
2 years ago
0.0.0-temp.1
2 years ago
0.0.0-temp.2
2 years ago
0.0.2
5 years ago
0.0.1
5 years ago
1.0.0
5 years ago