Skip to content

farm-fe/farmup

Repository files navigation

Farmup

easy run your TypeScript、JavaScript or html

powered by Farm


feature

  • cross import CommonJs and EsModule
  • watch mode
  • support html

Setup

pnpm i farmup

or install global

pnpm i -g farmup

Get Started

run js/ts file

farmup index.ts

run html file, because farm is used, even if it is html, it will automatically compile the referenced js and ts files.

farmup index.html

build and exec, but it can only-build

farmup build index.ts

# only-build
farmup build index.ts --no-exec

roadmap

  • support more entry file
  • more cli options
    • sourcemap
    • ignore some watch file
  • execute without output file

options

exec

  • alias: e

can custom exec, select the exec method by default through the suffix of the file

  • html use server star
  • ts\js use node
farmup index.ts -e node

farmup index.ts -e cat

format

  • option: cjs | esm
farmup --format cjs index.ts

minify

farmup --minify index.ts

config

custom specify farm config, for more, see farm config

by default, it automatically finds the configuration

if you not use local config, use --no-config option

target

define your production environment

watch

  • alias: w

add extra watch files, support glob pattern

external

set external package or path

autoExternal

  • default: true

in your code, if not find package or source, set external

sourcemap

  • default: undefined
  • option: boolean | 'inline' | 'all' | 'all-inline'

generate sourcemap