prettier-plugin-ember-template-tag icon indicating copy to clipboard operation
prettier-plugin-ember-template-tag copied to clipboard

Replaced vite with tsc for build

Open ijlee2 opened this issue 7 months ago • 0 comments

Background

Closes #360.

The published plugin is unusually large due to vite. In v2.0.5 (before .npmignore had been added), it had weighed at 3.73 MB. In v2.0.6, at 2.93 MB.

Using vite is also unnecessary for simple Node projects. We can use tsc to compile the TypeScript files, then publish the resulting dist folder. This results in fewer dependencies and a package size around 30.2 kB (0.8% of the size in v2.0.5, 1.01% of that in v2.0.6).

Before: Unpacked size of 2.9 MB
➜ npm publish --dry-un

> [email protected] prepack
> pnpm build

> [email protected] build
> tsc && vite build

npm notice Tarball Contents
npm notice 1.1kB LICENSE.md
npm notice 9.4kB README.md
npm notice 2.9MB dist/prettier-plugin-ember-template-tag.js
npm notice 2.8kB package.json
npm notice Tarball Details
npm notice name: prettier-plugin-ember-template-tag
npm notice version: 2.0.6
npm notice filename: prettier-plugin-ember-template-tag-2.0.6.tgz
npm notice package size: 555.8 kB
npm notice unpacked size: 2.9 MB
npm notice total files: 4
After: Unpacked size of 30.2 kB
➜ npm publish --dry-un

> [email protected] prepack
> pnpm build

> [email protected] build
> ./build.sh --production

SUCCESS: Built dist.

npm notice Tarball Contents
npm notice 1.1kB LICENSE.md
npm notice 9.4kB README.md
npm notice 536B dist/src/languages.js
npm notice 166B dist/src/main.js
npm notice 449B dist/src/options.js
npm notice 662B dist/src/parsers.js
npm notice 2.2kB dist/src/parsers/convert-ast.js
npm notice 67B dist/src/parsers/index.js
npm notice 2.5kB dist/src/parsers/preprocess.js
npm notice 3.2kB dist/src/printers.js
npm notice 1.1kB dist/src/printers/ambiguity.js
npm notice 347B dist/src/printers/ignore.js
npm notice 89B dist/src/printers/index.js
npm notice 2.3kB dist/src/printers/print.js
npm notice 1.6kB dist/src/types/glimmer.js
npm notice 217B dist/src/utils/assert.js
npm notice 854B dist/src/utils/content-tag.js
npm notice 395B dist/src/utils/doc.js
npm notice 202B dist/src/utils/index.js
npm notice 2.8kB package.json
npm notice Tarball Details
npm notice name: prettier-plugin-ember-template-tag
npm notice version: 2.0.6
npm notice filename: prettier-plugin-ember-template-tag-2.0.6.tgz
npm notice package size: 10.6 kB
npm notice unpacked size: 30.2 kB
npm notice total files: 20

ijlee2 avatar Jun 13 '25 09:06 ijlee2