Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): prevent generate task from crashing (#5693)
this pr is motivated by a scneario where running `npx stencil generate` would result in either an error or an early return: ``` npm run generate > gen-test-1@0.0.1 generate > stencil generate [49:23.1] @stencil/core [49:23.2] v4.17.0 ♨️ ``` note: the reported error was never reproduced locally, only the early return. technically, this was introduced in v4.17.0, when we switched over to using esbuild for production builds. however, this has been present in any build that is esbuild-based since we migrated the cli submodule to esbuild (where we had a mixed rollup-esbuild build during the migration for dev builds). removing this alias eliminates dynamic imports in the CJS output of the cli submodule: ``` const { prompt: r } = await import('../sys/node/prompts.js') ``` which wouldn't run properly, causing the error/early return. this change does cause an increase in bundle size, as we end up importing more of prompts.js than we do. to mitigate this, we direct the cli module to the export we actually use (leading to less getting bundled in the cli module). fixes: #5692 STENCIL-1294 cannot identified the prompts.js as a function? ?
- Loading branch information