## Usages
``ts
import { defineConfig } from '@flatjs/forge/define-config';
export default defineConfig({
output: {
format: 'cjs',
},
plugin: {
pluginConfigs: {
babelOptions: {
usePreset: 'react',
},
terserOptions: true,
},
},
});
`
Note:
1. Can use .mts extension if your package.json without "type": "module".ts
2. Can use ,.mts extension if your package.json with "type": "module"
define scripts in package.json
`json`
{ "forge": "flatjs-forge" }
1. Using Npm scripts
- yarn forge build --dtsyarn forge build --dts -f=esm
-
2. Using npx
- npx flatjs-forge build --dtsnpx flatjs-forge build --dts -f=esm
-
3. Show basic tips
- yarn forge -hyarn forge help
-
- npx flatjs-forge -hnpx flatjs-forge help
-
4. Show help info for command build
- yarn forge build -hyarn forge help build
-
- npx flatjs-forge build -hnpx flatjs-forge help build
-
Notes: if we must use --dts=false instead using -d=false to indicate dts:false, The same usage goes for the other boolean types (-c=false => --compress=false)
`json`
{ "baseUrl": "./src" }
We should not create folder name like rollup in src/rollup;
1. while we use import { moduleX } from rollup; it will resolve moduleX from src/rollup instead import from node_modulesvitest
2. while use it may broken cause of wrong rollup imported.src/rollup
3. change to src/create-rollup` is ok.