@normed/bundle 4.5.2 → 4.5.5
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/CHANGELOG.md +12 -0
- package/bundles/bin/cli.js +844 -695
- package/bundles/bin/cli.js.map +4 -4
- package/bundles/esbuild-plugins/css_url_resolver.d.ts +20 -0
- package/bundles/esbuild-plugins/index.d.ts +1 -0
- package/bundles/esbuild-plugins/load_pug.d.ts +16 -0
- package/bundles/index.js +844 -695
- package/bundles/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as esbuild from "esbuild";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an esbuild plugin that properly handles CSS url() references.
|
|
4
|
+
*
|
|
5
|
+
* This plugin is designed to run BEFORE the Yarn PnP plugin to prevent
|
|
6
|
+
* CSS url() values from being incorrectly treated as npm package specifiers.
|
|
7
|
+
*
|
|
8
|
+
* It handles:
|
|
9
|
+
* - Data URIs: `url("data:image/svg+xml;...")` - marked as external
|
|
10
|
+
* - Protocol URLs: `url(https://...)` - marked as external
|
|
11
|
+
* - Absolute paths: `url(/fonts/foo.woff)` - marked as external (runtime paths)
|
|
12
|
+
* - Protocol-relative: `url(//cdn.example.com/...)` - marked as external
|
|
13
|
+
* - Fragment URLs: `url(#gradient)` - marked as external
|
|
14
|
+
* - Relative paths: `url(images/foo.png)` - resolved relative to CSS file
|
|
15
|
+
*
|
|
16
|
+
* Without this plugin, the PnP plugin would see `images/layers.png` and
|
|
17
|
+
* try to resolve `images` as an npm package, causing build failures.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createCssUrlResolverPlugin(): esbuild.Plugin;
|
|
20
|
+
export default createCssUrlResolverPlugin;
|
|
@@ -2,3 +2,4 @@ export { default as load_less } from "./load_less";
|
|
|
2
2
|
export { default as load_pug } from "./load_pug";
|
|
3
3
|
export { default as load_ts_js } from "./load_ts_js";
|
|
4
4
|
export { createCssExternalUrlsPlugin } from "./css_external_urls";
|
|
5
|
+
export { createCssUrlResolverPlugin } from "./css_url_resolver";
|
|
@@ -6,14 +6,30 @@ export interface DiscoveredPugReference {
|
|
|
6
6
|
originalHref: string;
|
|
7
7
|
absolutePath: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Discovered less file reference from HTML.
|
|
11
|
+
*/
|
|
12
|
+
export interface DiscoveredLessReference {
|
|
13
|
+
originalHref: string;
|
|
14
|
+
absolutePath: string;
|
|
15
|
+
}
|
|
9
16
|
/**
|
|
10
17
|
* Map of source pug file path to discovered pug references.
|
|
11
18
|
* This is populated during build and used by the builder to trigger sub-builds.
|
|
12
19
|
*/
|
|
13
20
|
export declare const discoveredPugReferences: Map<string, DiscoveredPugReference[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Map of source pug file path to discovered less references.
|
|
23
|
+
* This is populated during build and used by the builder to trigger sub-builds.
|
|
24
|
+
*/
|
|
25
|
+
export declare const discoveredLessReferences: Map<string, DiscoveredLessReference[]>;
|
|
14
26
|
/**
|
|
15
27
|
* Clear discovered pug references. Should be called before a new build.
|
|
16
28
|
*/
|
|
17
29
|
export declare function clearDiscoveredPugReferences(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Clear discovered less references. Should be called before a new build.
|
|
32
|
+
*/
|
|
33
|
+
export declare function clearDiscoveredLessReferences(): void;
|
|
18
34
|
declare const plugin: esbuild.Plugin;
|
|
19
35
|
export default plugin;
|