lvyjs 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/main.js +8 -3
- package/package.json +1 -1
package/lib/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import module from 'node:module';
|
|
2
2
|
import { MessageChannel } from 'node:worker_threads';
|
|
3
3
|
import { postCSS } from './postcss.js';
|
|
4
|
+
import { assetsRegExp, stylesRegExp } from './config.js';
|
|
4
5
|
|
|
5
6
|
if (!module.register) {
|
|
6
7
|
throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);
|
|
@@ -22,9 +23,13 @@ module.register('./loader.js', {
|
|
|
22
23
|
data: {
|
|
23
24
|
port: port2,
|
|
24
25
|
lvyConfig: {
|
|
25
|
-
alias: global.lvyConfig
|
|
26
|
-
assets: global.lvyConfig
|
|
27
|
-
|
|
26
|
+
alias: global.lvyConfig?.alias,
|
|
27
|
+
assets: global.lvyConfig?.assets ?? {
|
|
28
|
+
filter: assetsRegExp
|
|
29
|
+
},
|
|
30
|
+
styles: global.lvyConfig?.styles ?? {
|
|
31
|
+
filter: stylesRegExp
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
transferList: [port2]
|