@octane-xplat/bamboo 0.10.0 → 0.11.0
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/package.json +1 -1
- package/src/vite.ts +21 -0
package/package.json
CHANGED
package/src/vite.ts
CHANGED
|
@@ -22,6 +22,27 @@ export function xplatBamboo({ native = false, ...options }: XplatBambooOptions =
|
|
|
22
22
|
cssPlugin.generateBundle.order = 'pre'
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
plugins.push({
|
|
26
|
+
name: 'xplat-bamboo:nativescript-entry-graph',
|
|
27
|
+
enforce: 'post',
|
|
28
|
+
transform(code, id) {
|
|
29
|
+
// @nativescript/vite builds from a generated entry
|
|
30
|
+
// (`virtual:entry-with-polyfills`). Under HMR that entry boots
|
|
31
|
+
// the app over HTTP instead of statically importing the app's
|
|
32
|
+
// main module, so `import 'virtual:bamboo.css'` there never
|
|
33
|
+
// enters the bundle's module graph — while class values still
|
|
34
|
+
// compile, tripping bamboocss's entry-graph check at buildEnd.
|
|
35
|
+
// Import the stylesheet from the generated entry itself so it
|
|
36
|
+
// is in the graph in every mode; the emitted asset then flows
|
|
37
|
+
// through the same generateBundle path as every other .css.
|
|
38
|
+
if (id !== '\0virtual:entry-with-polyfills' || code.includes('virtual:bamboo.css')) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return { code: `${code}\nimport 'virtual:bamboo.css';\n`, map: null }
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
|
|
25
46
|
plugins.push({
|
|
26
47
|
name: 'xplat-bamboo:nativescript-output',
|
|
27
48
|
enforce: 'post',
|