Skip to content

Frontend build warnings of INEFFECTIVE_DYNAMIC_IMPORT #18

@heapoftrash

Description

@heapoftrash

Describe the bug

There are frontend build warnings for Dynamic Import

To reproduce

cd frontend && npm run build

> filetree-frontend@0.0.0 build
> tsc -b && vite build

vite v8.0.0 building client environment for production...
✓ 3336 modules transformed.
computing gzip size...
dist/index.html                              1.02 kB │ gzip:   0.43 kB
dist/assets/index-DNF4WJnw.css               0.26 kB │ gzip:   0.22 kB
dist/assets/AudioPreview-D_e4cMnk.js         0.09 kB │ gzip:   0.10 kB
dist/assets/PdfPreview-SjOEg-ko.js           0.09 kB │ gzip:   0.10 kB
dist/assets/VideoPreview-BpsLYXjU.js         0.09 kB │ gzip:   0.10 kB
dist/assets/HtmlPreview-B3x8dKPQ.js          0.12 kB │ gzip:   0.11 kB
dist/assets/CsvPreview-C78ih5VF.js           0.18 kB │ gzip:   0.15 kB
dist/assets/JsonPreview-DuJdkpuh.js          0.18 kB │ gzip:   0.15 kB
dist/assets/MarkdownPreview-C-boGCLQ.js      0.18 kB │ gzip:   0.15 kB
dist/assets/ImagePreview-BG9WfOCn.js         0.21 kB │ gzip:   0.16 kB
dist/assets/TextPreview-BcJxsR10.js          0.26 kB │ gzip:   0.18 kB
dist/assets/searchHighlight-CC-gcVmO.js      0.33 kB │ gzip:   0.28 kB
dist/assets/ThemeContext-ECbWoTU6.js         0.90 kB │ gzip:   0.53 kB
dist/assets/jsx-runtime-D-oznMWL.js          1.05 kB │ gzip:   0.60 kB
dist/assets/react-DcCgrBX5.js                7.52 kB │ gzip:   2.88 kB
dist/assets/Settings-PXx-dtN3.js            25.84 kB │ gzip:   8.61 kB
dist/assets/theme-DVVZXATl.js               49.25 kB │ gzip:  19.29 kB
dist/assets/config-provider-CpbYjy25.js     55.89 kB │ gzip:  20.79 kB
dist/assets/errors-Dn8hln46.js             316.73 kB │ gzip: 105.92 kB
dist/assets/index-Bd_epon2.js            1,018.86 kB │ gzip: 317.73 kB

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/ImagePreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[plugin builtin:vite-reporter] 
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rolldownOptions.output.codeSplitting to improve chunking: https://rolldown.rs/reference/OutputOptions.codeSplitting
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/VideoPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/AudioPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/PdfPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/MarkdownPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/JsonPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/CsvPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/HtmlPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

[INEFFECTIVE_DYNAMIC_IMPORT] Warning: src/preview/TextPreview.tsx is dynamically imported by src/preview/PreviewLoader.tsx but also statically imported by src/preview/index.ts, dynamic import will not move module into another chunk.

Expected behavior

No warnings recorded

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfrontendRelated to frontend

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions