akauppi / GroundLevel-firebase-es

[ANCHORED] Stencil for operational web apps
https://groundlevel-sep22.web.app/
Other
23 stars 3 forks source link

app-deploy-ops: Vite build fails with stack overflow #35

Closed akauppi closed 3 years ago

akauppi commented 3 years ago

Would be interesting to get npm run build:vite to work - to get size comparisons between working Vite and Rollup builds.

Currently (recamp-firebase-9x branch):

$ npm run build:vite

> build:vite
> vite build -c vite/vite.config.js

vite v2.0.5 building for production...
✓ 24 modules transformed.
rendering chunks (13)...error during build:
RangeError: Maximum call stack size exceeded
    at getCssTagsForChunk (/Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23223:40)
    at /Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23228:38
    at Array.forEach (<anonymous>)
    at getCssTagsForChunk (/Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23225:31)
    at /Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23228:38
    at Array.forEach (<anonymous>)
    at getCssTagsForChunk (/Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23225:31)
    at /Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23228:38
    at Array.forEach (<anonymous>)
    at getCssTagsForChunk (/Users/asko/Git/GroundLevel-es-firebase/packages/app-deploy-ops/node_modules/vite/dist/node/chunks/dep-e0f09032.js:23225:31)
akauppi commented 3 years ago

Seems html.ts plugin is where it happens. Would require setting up a local copy of Vite, editing the sources to see what triggers the endless recursion.

akauppi commented 3 years ago

Only happens if cssCodeSplit: false in app's Vite config (creates CSS files, instead of embedding them in the code).

akauppi commented 3 years ago

There doesn't seem to be a compelling reason to use Vite for the deploy build. Closing.