Commit c30651e 1 parent 50c410e commit c30651e Copy full SHA for c30651e
File tree 1 file changed +3
-1
lines changed
packages/rollup-plugin-html/src/output
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { transform } from 'lightningcss';
4
4
import fs from 'fs' ;
5
5
6
6
import { InputAsset , InputData } from '../input/InputData' ;
7
+ import { createAssetPicomatchMatcher } from '../assets/utils.js' ;
7
8
import { RollupPluginHTMLOptions , TransformAssetFunction } from '../RollupPluginHTMLOptions' ;
8
9
9
10
export interface EmittedAssets {
@@ -81,6 +82,7 @@ export async function emitAssets(
81
82
82
83
let ref : string ;
83
84
let basename = path . basename ( asset . filePath ) ;
85
+ const isExternal = createAssetPicomatchMatcher ( options . externalAssets ) ;
84
86
const emittedExternalAssets = new Map ( ) ;
85
87
if ( asset . hashed ) {
86
88
if ( basename . endsWith ( '.css' ) && options . bundleAssetsFromCss ) {
@@ -95,7 +97,7 @@ export async function emitAssets(
95
97
// https://www.w3.org/TR/html4/types.html#:~:text=ID%20and%20NAME%20tokens%20must,tokens%20defined%20by%20other%20attributes.
96
98
const [ filePath , idRef ] = url . url . split ( '#' ) ;
97
99
98
- if ( shouldHandleAsset ( filePath ) ) {
100
+ if ( shouldHandleAsset ( filePath ) && ! isExternal ( filePath ) ) {
99
101
// Read the asset file, get the asset from the source location on the FS using asset.filePath
100
102
const assetLocation = path . resolve ( path . dirname ( asset . filePath ) , filePath ) ;
101
103
const assetContent = fs . readFileSync ( assetLocation ) ;
You can’t perform that action at this time.
0 commit comments