@timber-js/app 0.2.0-alpha.5 → 0.2.0-alpha.6
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/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/plugins/fonts.ts +6 -2
package/dist/index.js
CHANGED
|
@@ -13357,10 +13357,10 @@ async function isCacheHit(metaPath, dataPath) {
|
|
|
13357
13357
|
//#region src/plugins/fonts.ts
|
|
13358
13358
|
var VIRTUAL_GOOGLE = "@timber/fonts/google";
|
|
13359
13359
|
var VIRTUAL_LOCAL = "@timber/fonts/local";
|
|
13360
|
-
var VIRTUAL_FONT_CSS = "virtual:timber-fonts
|
|
13360
|
+
var VIRTUAL_FONT_CSS = "virtual:timber-fonts.css";
|
|
13361
13361
|
var RESOLVED_GOOGLE = "\0@timber/fonts/google";
|
|
13362
13362
|
var RESOLVED_LOCAL = "\0@timber/fonts/local";
|
|
13363
|
-
var RESOLVED_FONT_CSS = "\0virtual:timber-fonts
|
|
13363
|
+
var RESOLVED_FONT_CSS = "\0virtual:timber-fonts.css";
|
|
13364
13364
|
/**
|
|
13365
13365
|
* Convert a font family name to a PascalCase export name.
|
|
13366
13366
|
* e.g. "JetBrains Mono" → "JetBrains_Mono"
|
|
@@ -13681,10 +13681,13 @@ function timberFonts(ctx) {
|
|
|
13681
13681
|
}
|
|
13682
13682
|
}
|
|
13683
13683
|
if (hasLocalImport) transformedCode = transformLocalFonts(transformedCode, code, id, registry, this.error.bind(this));
|
|
13684
|
-
if (transformedCode !== code)
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13684
|
+
if (transformedCode !== code) {
|
|
13685
|
+
transformedCode = `import '${VIRTUAL_FONT_CSS}';\n` + transformedCode;
|
|
13686
|
+
return {
|
|
13687
|
+
code: transformedCode,
|
|
13688
|
+
map: null
|
|
13689
|
+
};
|
|
13690
|
+
}
|
|
13688
13691
|
return null;
|
|
13689
13692
|
},
|
|
13690
13693
|
generateBundle() {
|