@vue/compiler-sfc 2.7.8 → 2.7.9
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/compiler-sfc.js +14 -3
- package/package.json +1 -1
package/dist/compiler-sfc.js
CHANGED
|
@@ -8181,7 +8181,13 @@ function rewriteDefault(input, as, parserPlugins) {
|
|
|
8181
8181
|
}).program.body;
|
|
8182
8182
|
ast.forEach(node => {
|
|
8183
8183
|
if (node.type === 'ExportDefaultDeclaration') {
|
|
8184
|
-
|
|
8184
|
+
if (node.declaration.type === 'ClassDeclaration') {
|
|
8185
|
+
s.overwrite(node.start, node.declaration.id.start, `class `);
|
|
8186
|
+
s.append(`\nconst ${as} = ${node.declaration.id.name}`);
|
|
8187
|
+
}
|
|
8188
|
+
else {
|
|
8189
|
+
s.overwrite(node.start, node.declaration.start, `const ${as} = `);
|
|
8190
|
+
}
|
|
8185
8191
|
}
|
|
8186
8192
|
if (node.type === 'ExportNamedDeclaration') {
|
|
8187
8193
|
for (const specifier of node.specifiers) {
|
|
@@ -9703,9 +9709,14 @@ function urlToRequire(url, transformAssetUrlsOption = {}) {
|
|
|
9703
9709
|
// does not apply to absolute urls or urls that start with `@`
|
|
9704
9710
|
// since they are aliases
|
|
9705
9711
|
if (firstChar === '.' || firstChar === '~') {
|
|
9712
|
+
// Allow for full hostnames provided in options.base
|
|
9713
|
+
const base = parseUriParts(transformAssetUrlsOption.base);
|
|
9714
|
+
const protocol = base.protocol || '';
|
|
9715
|
+
const host = base.host ? protocol + '//' + base.host : '';
|
|
9716
|
+
const basePath = base.path || '/';
|
|
9706
9717
|
// when packaged in the browser, path will be using the posix-
|
|
9707
9718
|
// only version provided by rollup-plugin-node-builtins.
|
|
9708
|
-
return `"${(path__default["default"].posix || path__default["default"]).join(
|
|
9719
|
+
return `"${host}${(path__default["default"].posix || path__default["default"]).join(basePath, uriParts.path + (uriParts.hash || ''))}"`;
|
|
9709
9720
|
}
|
|
9710
9721
|
}
|
|
9711
9722
|
if (transformAssetUrlsOption.includeAbsolute ||
|
|
@@ -9737,7 +9748,7 @@ function parseUriParts(urlString) {
|
|
|
9737
9748
|
// @see https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
|
|
9738
9749
|
if ('string' === typeof urlString) {
|
|
9739
9750
|
// check is an uri
|
|
9740
|
-
return url.parse(urlString); // take apart the uri
|
|
9751
|
+
return url.parse(urlString, false, true); // take apart the uri
|
|
9741
9752
|
}
|
|
9742
9753
|
}
|
|
9743
9754
|
return returnValue;
|