@flatjs/forge
TypeScript icon, indicating that this package has built-in type declarations

2.0.6 • Public • Published

@flatjs/forge

Usages

The configuration file flatjs-forge.config.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"
  2. Can use .ts,.mts extension if your package.json with "type": "module"

Forge CLI

define scripts in package.json

{ "forge": "flatjs-forge" }
  1. Using Npm scripts
  • yarn forge build --dts
  • yarn forge build --dts -f=esm
  1. Using npx
  • npx flatjs-forge build --dts
  • npx flatjs-forge build --dts -f=esm
  1. Show basic tips
  • yarn forge -h

  • yarn forge help

  • npx flatjs-forge -h

  • npx flatjs-forge help

  1. Show help info for command build
  • yarn forge build -h

  • yarn forge help build

  • npx flatjs-forge build -h

  • npx 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)

Note: because below configuration of tsconfig.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_modules
  2. while use vitest it may broken cause of wrong rollup imported.
  3. change src/rollup to src/create-rollup is ok.

Readme

Keywords

none

Package Sidebar

Install

npm i @flatjs/forge

Weekly Downloads

35

Version

2.0.6

License

MIT

Unpacked Size

40.5 kB

Total Files

69

Last publish

Collaborators

  • tianyingchun