Development

The following method is to improve the Gem development experience.

Language Support

Install extension:

Formatting

Prettier

prettier defaults to support the inline html/css template, but does not supportcss({}), use the following command to install prettier To support the formatting of this style:

pnpm add -D prettier@npm:@mantou/prettier

Biome

biome v2 defaults to support the inline html/css template, but does not supportcss({}).

HMR

Enable HMR in three steps(Only swc based bundlers are supported):

  1. Turn on hot in the build tool, such as Webpack
  2. Add @mantou/gem/helper/hmr to build tool config entry
  3. Add swc plugin and enable hmr