Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Bump build files
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Jan 25, 2024
1 parent c543eac commit 92cf91e
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 50 deletions.
4 changes: 2 additions & 2 deletions dist/descriptorCache.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SFCDescriptor } from 'vue/compiler-sfc';
import type { CompilerOptions, SFCDescriptor } from 'vue/compiler-sfc';
export declare const descriptorCache: Map<string, SFCDescriptor>;
export declare function setDescriptor(filename: string, entry: SFCDescriptor): void;
export declare function getDescriptor(filename: string): SFCDescriptor;
export declare function getDescriptor(filename: string, compilerOptions?: CompilerOptions): SFCDescriptor;
9 changes: 3 additions & 6 deletions dist/descriptorCache.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -32,7 +28,7 @@ function setDescriptor(filename, entry) {
exports.descriptorCache.set(cleanQuery(filename), entry);
}
exports.setDescriptor = setDescriptor;
function getDescriptor(filename) {
function getDescriptor(filename, compilerOptions) {
filename = cleanQuery(filename);
if (exports.descriptorCache.has(filename)) {
return exports.descriptorCache.get(filename);
Expand All @@ -46,6 +42,7 @@ function getDescriptor(filename) {
const { descriptor } = parse(source, {
filename,
sourceMap: true,
templateParseOptions: compilerOptions,
});
exports.descriptorCache.set(filename, descriptor);
return descriptor;
Expand Down
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -28,8 +24,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.VueLoaderPlugin = void 0;
const path = __importStar(require("path"));
const crypto = __importStar(require("crypto"));
const qs = __importStar(require("querystring"));
const hash = require("hash-sum");
const compiler_1 = require("./compiler");
const select_1 = require("./select");
const hotReload_1 = require("./hotReload");
Expand All @@ -43,6 +39,9 @@ const util_1 = require("./util");
let errorEmitted = false;
const { parse } = compiler_1.compiler;
const exportHelperPath = require.resolve('./exportHelper');
function hash(text) {
return crypto.createHash('sha256').update(text).digest('hex').substring(0, 8);
}
function loader(source) {
var _a;
const loaderContext = this;
Expand All @@ -68,6 +67,7 @@ function loader(source) {
const { descriptor, errors } = parse(source, {
filename,
sourceMap,
templateParseOptions: options.compilerOptions,
});
const asCustomElement = typeof options.customElement === 'boolean'
? options.customElement
Expand Down
6 changes: 1 addition & 5 deletions dist/pitcher.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down
8 changes: 2 additions & 6 deletions dist/pluginWebpack4.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down Expand Up @@ -80,7 +76,7 @@ class VueLoaderPlugin {
const parsed = qs.parse(query.slice(1));
return parsed.vue != null && parsed.type === 'template';
},
options: vueLoaderOptions,
options: Object.assign({ ident: vueLoaderUse.ident }, vueLoaderOptions),
};
// for each rule that matches plain .js/.ts files, also create a clone and
// match it against the compiled template code inside *.vue files, so that
Expand Down
6 changes: 1 addition & 5 deletions dist/pluginWebpack5.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down
6 changes: 3 additions & 3 deletions dist/resolveScript.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { LoaderContext } from 'webpack';
import type { SFCDescriptor } from 'vue/compiler-sfc';
import type { SFCDescriptor, SFCScriptBlock } from 'vue/compiler-sfc';
import type { VueLoaderOptions } from 'src';
export declare const clientCache: WeakMap<SFCDescriptor, any>;
export declare const clientCache: WeakMap<SFCDescriptor, SFCScriptBlock | null>;
export declare const typeDepToSFCMap: Map<string, Set<string>>;
/**
* inline template mode can only be enabled if:
Expand All @@ -10,4 +10,4 @@ export declare const typeDepToSFCMap: Map<string, Set<string>>;
* - template is not using src
*/
export declare function canInlineTemplate(descriptor: SFCDescriptor, isProd: boolean): boolean;
export declare function resolveScript(descriptor: SFCDescriptor, scopeId: string, options: VueLoaderOptions, loaderContext: LoaderContext<VueLoaderOptions>): any;
export declare function resolveScript(descriptor: SFCDescriptor, scopeId: string, options: VueLoaderOptions, loaderContext: LoaderContext<VueLoaderOptions>): SFCScriptBlock | null;
1 change: 1 addition & 0 deletions dist/resolveScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function resolveScript(descriptor, scopeId, options, loaderContext) {
id: scopeId,
isProd,
inlineTemplate: enableInline,
// @ts-ignore this has been removed in 3.4
reactivityTransform: options.reactivityTransform,
propsDestructure: options.propsDestructure,
defineModel: options.defineModel,
Expand Down
1 change: 1 addition & 0 deletions dist/select.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="node" />
import type { LoaderContext } from 'webpack';
import type { SFCDescriptor } from 'vue/compiler-sfc';
import type { ParsedUrlQuery } from 'querystring';
Expand Down
11 changes: 6 additions & 5 deletions dist/stylePostLoader.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -31,6 +27,11 @@ const { compileStyle } = compiler_1.compiler;
// for any <style scoped> selection requests initiated from within vue files.
const StylePostLoader = function (source, inMap) {
const query = qs.parse(this.resourceQuery.slice(1));
// skip normal CSS files
if (!('vue' in query) || query.type !== 'style' || !query.id) {
this.callback(null, source, inMap);
return;
}
const { code, map, errors } = compileStyle({
source: source,
filename: this.resourcePath,
Expand Down
11 changes: 5 additions & 6 deletions dist/templateLoader.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down Expand Up @@ -45,7 +41,7 @@ const TemplateLoader = function (source, inMap) {
const isProd = loaderContext.mode === 'production' || process.env.NODE_ENV === 'production';
const query = qs.parse(loaderContext.resourceQuery.slice(1));
const scopeId = query.id;
const descriptor = (0, descriptorCache_1.getDescriptor)(loaderContext.resourcePath);
const descriptor = (0, descriptorCache_1.getDescriptor)(loaderContext.resourcePath, options.compilerOptions);
const script = (0, resolveScript_1.resolveScript)(descriptor, query.id, options, loaderContext);
let templateCompiler;
if (typeof options.compiler === 'string') {
Expand All @@ -56,6 +52,9 @@ const TemplateLoader = function (source, inMap) {
}
const compiled = compileTemplate({
source,
ast: descriptor.template && !descriptor.template.lang
? descriptor.template.ast
: undefined,
filename: loaderContext.resourcePath,
inMap,
id: scopeId,
Expand Down
2 changes: 1 addition & 1 deletion dist/util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export declare function resolveTemplateTSOptions(descriptor: SFCDescriptor, opti
export declare function getOptions(loaderContext: LoaderContext<VueLoaderOptions>): any;
export declare function stringifyRequest(loaderContext: LoaderContext<VueLoaderOptions>, request: string): string;
export declare function genMatchResource(context: LoaderContext<VueLoaderOptions>, resourcePath: string, resourceQuery?: string, lang?: string): string;
export declare const testWebpack5: (compiler?: any) => boolean;
export declare const testWebpack5: (compiler?: Compiler | undefined) => boolean;
6 changes: 1 addition & 5 deletions dist/util.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down

0 comments on commit 92cf91e

Please sign in to comment.