@parcel/transformer-html
Advanced tools
Comparing version 2.0.0-nightly.72 to 2.0.0-nightly.79
@@ -50,3 +50,3 @@ "use strict"; | ||
(0, _dependencies.default)(asset, options); | ||
return [asset, ...(0, _inline.default)(asset)]; | ||
return [asset, ...(0, _inline.default)(asset, options)]; | ||
}, | ||
@@ -53,0 +53,0 @@ |
@@ -21,6 +21,7 @@ "use strict"; | ||
'application/ld+json': 'jsonld', | ||
'text/html': false | ||
'text/html': false, | ||
module: 'js' | ||
}; | ||
function extractInlineAssets(asset) { | ||
function extractInlineAssets(asset, options) { | ||
let ast = (0, _nullthrows.default)(asset.ast); | ||
@@ -38,3 +39,3 @@ let program = ast.program; | ||
if (value != null) { | ||
let type; | ||
let type, env; | ||
@@ -58,2 +59,8 @@ if (node.tag === 'style') { | ||
} | ||
if (node.attrs.type === 'module' && options.scopeHoist) { | ||
env = { | ||
outputFormat: 'esmodule' | ||
}; | ||
} | ||
} else { | ||
@@ -86,2 +93,3 @@ type = 'js'; | ||
isInline: true, | ||
env, | ||
meta: { | ||
@@ -88,0 +96,0 @@ type: 'tag', |
{ | ||
"name": "@parcel/transformer-html", | ||
"version": "2.0.0-nightly.72+a0d19756", | ||
"version": "2.0.0-nightly.79+287ac639", | ||
"license": "MIT", | ||
@@ -19,4 +19,4 @@ "publishConfig": { | ||
"dependencies": { | ||
"@parcel/plugin": "2.0.0-nightly.72+a0d19756", | ||
"@parcel/utils": "2.0.0-nightly.72+a0d19756", | ||
"@parcel/plugin": "2.0.0-nightly.79+287ac639", | ||
"@parcel/utils": "2.0.0-nightly.79+287ac639", | ||
"nullthrows": "^1.1.1", | ||
@@ -28,3 +28,3 @@ "posthtml": "^0.11.3", | ||
}, | ||
"gitHead": "a0d19756a842b80ae8114b9e664a3b84057fcb70" | ||
"gitHead": "287ac6397ade28595d56ac73971edb832bda8ff7" | ||
} |
@@ -30,3 +30,3 @@ // @flow | ||
collectDependencies(asset, options); | ||
return [asset, ...extractInlineAssets(asset)]; | ||
return [asset, ...extractInlineAssets(asset, options)]; | ||
}, | ||
@@ -33,0 +33,0 @@ |
// @flow strict-local | ||
import type {MutableAsset, TransformerResult} from '@parcel/types'; | ||
import type { | ||
MutableAsset, | ||
PluginOptions, | ||
TransformerResult, | ||
} from '@parcel/types'; | ||
import {md5FromString} from '@parcel/utils'; | ||
@@ -16,2 +20,3 @@ import type {PostHTMLNode} from 'posthtml'; | ||
'text/html': false, | ||
module: 'js', | ||
}; | ||
@@ -21,2 +26,3 @@ | ||
asset: MutableAsset, | ||
options: PluginOptions, | ||
): Array<TransformerResult> { | ||
@@ -34,3 +40,3 @@ let ast = nullthrows(asset.ast); | ||
if (value != null) { | ||
let type; | ||
let type, env; | ||
@@ -54,2 +60,8 @@ if (node.tag === 'style') { | ||
} | ||
if (node.attrs.type === 'module' && options.scopeHoist) { | ||
env = { | ||
outputFormat: 'esmodule', | ||
}; | ||
} | ||
} else { | ||
@@ -87,2 +99,3 @@ type = 'js'; | ||
isInline: true, | ||
env, | ||
meta: { | ||
@@ -89,0 +102,0 @@ type: 'tag', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
18016
535