Skip to content

Commit

Permalink
Only copy the typescript files that we need (#246)
Browse files Browse the repository at this point in the history
This drops our bundle size from 15MB to 7.41MB
  • Loading branch information
rictic authored Apr 15, 2022
1 parent 3fa3141 commit 97d08cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vscode-lit-plugin/copy-to-built.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const { copy, mkdirp, writeFile } = require("fs-extra");
async function main() {
// We don't bundle the typescript compiler into ./built/bundle.js, so we need
// a copy of it.
await copy("./node_modules/typescript", "./built/node_modules/typescript");
await mkdirp("./node_modules/typescript/lib");
await copy("./node_modules/typescript/package.json", "./built/node_modules/typescript/package.json");
await copy("./node_modules/typescript/lib/typescript.js", "./built/node_modules/typescript/lib/typescript.js");
await copy("./node_modules/typescript/lib/tsserverlibrary.js", "./built/node_modules/typescript/lib/tsserverlibrary.js");

// For the TS compiler plugin, it must be in node modules because that's
// hard coded by the TS compiler's custom module resolution logic.
Expand Down

0 comments on commit 97d08cd

Please sign in to comment.