esbuild-plugin-vue3
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -209,3 +209,3 @@ "use strict"; | ||
build.onLoad({ filter: /\.vue$/ }, function (args) { return cache.get([args.path, args.namespace], function () { return __awaiter(_this, void 0, void 0, function () { | ||
var encPath, source, filename, descriptor, id, dataId, code, style, renderFuncName; | ||
var encPath, source, filename, id, descriptor, script, dataId, code, style, renderFuncName; | ||
return __generator(this, function (_a) { | ||
@@ -219,8 +219,9 @@ switch (_a.label) { | ||
filename = path.relative(process.cwd(), args.path); | ||
id = !opts.scopeId || opts.scopeId === "hash" | ||
? crypto.createHash("md5").update(filename).digest().toString("hex").substring(0, 8) | ||
: random(4).toString("hex"); | ||
descriptor = sfc.parse(source, { | ||
filename: filename | ||
}).descriptor; | ||
id = !opts.scopeId || opts.scopeId === "hash" | ||
? crypto.createHash("md5").update(filename).digest().toString("hex").substring(0, 8) | ||
: random(4).toString("hex"); | ||
script = (descriptor.script || descriptor.scriptSetup) ? sfc.compileScript(descriptor, { id: id }) : undefined; | ||
dataId = "data-v-" + id; | ||
@@ -250,3 +251,3 @@ code = ""; | ||
resolveDir: path.dirname(args.path), | ||
pluginData: { descriptor: descriptor, id: dataId }, | ||
pluginData: { descriptor: descriptor, id: dataId, script: script }, | ||
watchFiles: [args.path] | ||
@@ -258,7 +259,6 @@ }]; | ||
build.onLoad({ filter: /.*/, namespace: "sfc-script" }, function (args) { return cache.get([args.path, args.namespace], function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, descriptor, id, script, code, sourceMap; | ||
return __generator(this, function (_b) { | ||
_a = args.pluginData, descriptor = _a.descriptor, id = _a.id; | ||
if (descriptor.script || descriptor.scriptSetup) { | ||
script = sfc.compileScript(descriptor, { id: id }); | ||
var script, code, sourceMap; | ||
return __generator(this, function (_a) { | ||
script = args.pluginData.script; | ||
if (script) { | ||
code = script.content; | ||
@@ -279,7 +279,7 @@ if (buildOpts.sourcemap && script.map) { | ||
build.onLoad({ filter: /.*/, namespace: "sfc-template" }, function (args) { return cache.get([args.path, args.namespace], function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, descriptor, id, source, pug, result; | ||
var _a, descriptor, id, script, source, pug, result; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = args.pluginData, descriptor = _a.descriptor, id = _a.id; | ||
_a = args.pluginData, descriptor = _a.descriptor, id = _a.id, script = _a.script; | ||
if (!descriptor.template) { | ||
@@ -308,3 +308,5 @@ throw new Error("Missing template"); | ||
compilerOptions: { | ||
directiveTransforms: transforms | ||
inSSR: opts.renderSSR, | ||
directiveTransforms: transforms, | ||
bindingMetadata: script === null || script === void 0 ? void 0 : script.bindings | ||
} | ||
@@ -311,0 +313,0 @@ }); |
{ | ||
"name": "esbuild-plugin-vue3", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -16,5 +16,5 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@vue/compiler-core": "^3.1.5", | ||
"@vue/compiler-sfc": "^3.1.5", | ||
"esbuild": "^0.12.15" | ||
"@vue/compiler-core": "^3.2.6", | ||
"@vue/compiler-sfc": "^3.2.6", | ||
"esbuild": "^0.12.22" | ||
}, | ||
@@ -21,0 +21,0 @@ "keywords": [ |
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
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
58535
933
Updated@vue/compiler-core@^3.2.6
Updated@vue/compiler-sfc@^3.2.6
Updatedesbuild@^0.12.22