| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6b0b9be commit 69acf5b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,7 @@ import type { BundleStylesheetOptions } from './bundle-options'; | |||
| 26 | 26 | * - `publicPath`: Affects relative asset URL rewriting (`url('...')`) inside CSS output. | |
| 27 | 27 | * - `outputNames`: Affects asset output filename hashing schemes. | |
| 28 | 28 | * - `inlineFonts`: Controls whether external web font `@import` / `<link>` directives are inlined. | |
| 29 | + * - `dataurl`: Controls whether referenced assets are inlined as base64 data URIs. | ||
| 29 | 30 | * - `preserveSymlinks`: Controls symlink realpath resolution in monorepos/pnpm workspace packages. | |
| 30 | 31 | * - `externalDependencies`: Controls which CSS modules/urls are excluded from bundling. | |
| 31 | 32 | * - `postcssConfig`: Path to custom PostCSS configuration file. | |
@@ -56,6 +57,7 @@ export function calculateGlobalStylesheetConfigHash( | |||
| 56 | 57 | publicPath: options.publicPath, | |
| 57 | 58 | outputNames: options.outputNames, | |
| 58 | 59 | inlineFonts: options.inlineFonts, | |
| 60 | + dataurl: options.dataurl ?? false, | ||
| 59 | 61 | preserveSymlinks: options.preserveSymlinks, | |
| 60 | 62 | externalDependencies: options.externalDependencies, | |
| 61 | 63 | postcssConfig: options.postcssConfiguration?.configPath | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,5 +70,20 @@ describe('Stylesheet Global Config Hash', () => { | |||
| 70 | 70 | ); | |
| 71 | 71 | expect(hash1).not.toBe(hash2); | |
| 72 | 72 | }); | |
| 73 | + | ||
| 74 | + it('should produce different hashes when dataurl changes', () => { | ||
| 75 | + const hash1 = calculateGlobalStylesheetConfigHash(baseOptions, '1.0.0'); | ||
| 76 | + const hash2 = calculateGlobalStylesheetConfigHash({ ...baseOptions, dataurl: true }, '1.0.0'); | ||
| 77 | + expect(hash1).not.toBe(hash2); | ||
| 78 | + }); | ||
| 79 | + | ||
| 80 | + it('should produce the same hash when dataurl is undefined or false', () => { | ||
| 81 | + const hash1 = calculateGlobalStylesheetConfigHash(baseOptions, '1.0.0'); | ||
| 82 | + const hash2 = calculateGlobalStylesheetConfigHash( | ||
| 83 | + { ...baseOptions, dataurl: false }, | ||
| 84 | + '1.0.0', | ||
| 85 | + ); | ||
| 86 | + expect(hash1).toBe(hash2); | ||
| 87 | + }); | ||
| 73 | 88 | }); | |
| 74 | 89 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments