Skip to content

[components] Expose the worker in a specific file instead of inlining it? #15

Description

@severo

The worker is currently inlined (base64):

import ParquetWorker from './parquetWorker?worker&inline'

The result from npm run build:

> @hyparam/components@0.1.0 build
> tsc && vite build

vite v5.4.10 building for production...
✓ 42 modules transformed.

[vite:dts] Start generate declaration files...
computing gzip size (0)...[vite:dts] Declaration files built in 2095ms.

dist/index.es.js  237.16 kB │ gzip: 124.11 kB │ map: 128.20 kB
dist/index.umd.js  225.50 kB │ gzip: 122.69 kB │ map: 124.80 kB
✓ built in 2.83s

The alternative is to remove &inline. In this case, the result of npm run build is:

> @hyparam/components@0.1.0 build
> tsc && vite build

vite v5.4.10 building for production...
✓ 42 modules transformed.

[vite:dts] Start generate declaration files...
dist/assets/parquetWorker-KNlj7o13.js  145.82 kB
dist/index.es.js                        42.16 kB │ gzip: 12.44 kB │ map: 128.00 kB
[vite:dts] Declaration files built in 2181ms.

dist/index.umd.js  30.63 kB │ gzip: 11.03 kB │ map: 124.65 kB
✓ built in 2.92s

But it means the users must serve the worker file in their app, which means docs + support.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions