-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Updates in version v4
- Updated typescript v5 dependency
- Updated jest v29 dependency
- Refactored feature package management
- Refactored create-tsbb based on package internal examples generation
- Updated template examples
- tsbb build [options]
+ tsbb build [source…] [options]
- --entry, -e
- --emit-type
- --no-emit-type
- --disable-babel
- --no-babel-option
- --file-names, -f
+ --use-babel Use Babel.(works in babel)
+ --bail Exit the compile as soon as the compile fails(default: true).
--source-maps Enables the generation of sourcemap files.(works in babel)
--env-name The current active environment used during configuration loading.(works in babel)
--esm Output "esm" directory.(works in babel)
--cjs Output "cjs" directory.(works in babel)- $ tsbb build --file-names src/main.ts --file-names src/good.ts
+ $ tsbb build src/main.ts src/good.ts- $ tsbb build --entry src/main.ts
+ $ tsbb build src/main.ts+ $ tsbb build src/*.ts # Build your project.
+ $ tsbb build src/main.ts src/good.ts # Specify the entry directory.$ tsbb build src/*.ts --use-babel --no-source-maps # No ".js.map" file is generated. (works in babel)
$ tsbb watch src/*.ts --use-babel --cjs ./cjs # Watch Output directory.
$ tsbb build src/*.ts --use-babel --esm ./es # Output directory.
$ tsbb build src/*.ts --use-babel --use-vue # To add Vue JSX support.
$ tsbb test # Run test suites related
$ tsbb test --coverage --bail # Test coverage information should be collectedUsage: create-tsbb <app-name> [options] [--help|h]
Options:
--version, -v Show version number
--help, -h Displays help information.
- --output, -o Output directory.
--example, -e Example from: https://jaywcjlove.github.io/tsbb , default: "basic"
--force, -f Overwrite target directory if it exists. default: false
- --path, -p Specify the download target git address. default: "https://jaywcjlove.github.io/tsbb"TypeScript Project
To configure the tsconfig.json properly, you must first define either the include or files field(s) to specify which files need to be compiled. Once you've done that, you can then specify the outDir for the output directory in the configuration.
{
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"outDir": "./lib",
"strict": true,
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}After completing tsconfig.json configuration, you can configure scripts in package.json:
{
"scripts": {
"watch": "tsbb watch",
"build": "tsbb build"
},
"devDependencies": {
"tsbb": "*"
}
}Babel Project
Adding the parameter --use-babel to your project enables babel to compile and output cjs/esm files simultaneously, while ts is only needed for type output.
$ tsbb build "src/*ts" --use-babelYou can change the built-in settings of Babel by adding a .babelrc configuration file. Additionally, you can modify the Babel configurations for esm and cjs separately through environment variables. Please refer to the example below:
{
"env": {
"cjs": {
"presets": ["@babel/preset-typescript"]
},
"esm": {
"presets": ["@babel/preset-env", {
"modules": false,
"loose": true,
"targets": {
"esmodules": true,
},
}]
}
}
}At compile time, specify the environment variable --envName='xxx' to enable reading of relevant configurations from the settings. This environment variable can also be customized.
{
"env": {
"xxx": { ... }
}
}jest dependency issue
- uiwjs/react-back-to-top@3007e3d#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R50-R54
- uiwjs/react-split@1c67dba#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R61-R65
- uiwjs/react-codemirror@e938690#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R37-R41