You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin responds to the following configuration options:
43
43
```javascript
44
44
webWorkerLoader({
45
-
targetPlatform?: string, // The platform workers should be built for, can be 'auto', 'browser' or 'node'.
46
-
// specifying either 'browser' or 'node' reduces the amount of loader code.
45
+
targetPlatform?: string, // The platform workers should be built for, can be 'auto', 'browser', 'node' or 'base64'.
46
+
// specifying a target platform other than 'auto' reduces the amount of loader code.
47
+
// The `base64` options forces inline and the import results on a base64 string that
48
+
// encodes the worker's source code. NOTE: The string does not include a mime type.
49
+
// 'auto' detectes the target platform and selects between 'browser` and 'node'.
47
50
// Default: 'auto'
48
51
49
52
pattern?: RegEx, // A RegEx instance describing the pattern that matches the files to import as
@@ -66,6 +69,10 @@ webWorkerLoader({
66
69
67
70
preserveSource?: boolean, // When inlined and this option is enabled, the full source code is included in the
68
71
// built file, otherwise it's embedded as a base64 string. Default: false
72
+
73
+
preserveFileNames?: boolean, // When code splitting is used (`inline === false`) the input worker file names are
74
+
// preserved, if duplicates are found `-n` is appended to the file names.
75
+
// Default: false
69
76
70
77
enableUnicodeSupport?: boolean, // When inlined in Base64 format, this option enables unicode support (UTF16). This
71
78
// flag is disabled by default because supporting UTF16 doubles the size of the final
@@ -92,6 +99,8 @@ The `sourcemap` configuration option is ignored when `inline` is set to `false`,
92
99
93
100
`loadPath` is meant to be used in situations where code-splitting is used (`inline = false`) and the entry script is hosted in a different folder than the worker code.
94
101
102
+
Setting `targetPlatform` to `'base64'` will ignore the `inline` option and will always inline the resulting code.
0 commit comments