esbuild-plugin-vue3
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -72,2 +72,3 @@ "use strict"; | ||
var path = __importStar(require("path")); | ||
var utils_1 = require("./utils"); | ||
function generateIndexHTML(result, opts, min) { | ||
@@ -85,3 +86,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
} | ||
return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require("cheerio")); })]; | ||
return [4 /*yield*/, utils_1.tryAsync(function () { return Promise.resolve().then(function () { return __importStar(require("cheerio")); }); }, "cheerio", "HTML generation")]; | ||
case 1: | ||
@@ -124,3 +125,3 @@ cheerio = _d.sent(); | ||
if (!min) return [3 /*break*/, 4]; | ||
return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require("html-minifier")); })]; | ||
return [4 /*yield*/, utils_1.tryAsync(function () { return Promise.resolve().then(function () { return __importStar(require("html-minifier")); }); }, "html-minifier", "HTML minification")]; | ||
case 3: | ||
@@ -127,0 +128,0 @@ minify = (_d.sent()).minify; |
@@ -217,3 +217,3 @@ "use strict"; | ||
build.onLoad({ filter: /.*/, namespace: "sfc-template" }, function (args) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, descriptor, id, source, template; | ||
var _a, descriptor, id, source, pug, template; | ||
return __generator(this, function (_b) { | ||
@@ -228,5 +228,6 @@ switch (_b.label) { | ||
if (!(descriptor.template.lang === "pug")) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require("pug")); })]; | ||
return [4 /*yield*/, utils_1.tryAsync(function () { return Promise.resolve().then(function () { return __importStar(require("pug")); }); }, "pug", "Pug template rendering")]; | ||
case 1: | ||
source = (_b.sent()).render(descriptor.template.content); | ||
pug = _b.sent(); | ||
source = pug.render(descriptor.template.content); | ||
// Fix #default="#default" and v-else="v-else" | ||
@@ -260,3 +261,3 @@ source = source.replace(/(\B#.*?|\bv-.*?)="\1"/g, "$1"); | ||
if (!(style.lang === "sass" || style.lang === "scss")) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require("sass")); })]; | ||
return [4 /*yield*/, utils_1.tryAsync(function () { return Promise.resolve().then(function () { return __importStar(require("sass")); }); }, "sass", "SASS style preprocessing")]; | ||
case 1: | ||
@@ -263,0 +264,0 @@ sass_1 = _b.sent(); |
@@ -7,1 +7,2 @@ /// <reference types="node" /> | ||
export declare function getFullPath(args: OnResolveArgs): string; | ||
export declare function tryAsync<T>(fn: () => Promise<T>, module: string, requiredFor: string): Promise<T>; |
@@ -58,3 +58,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFullPath = exports.fileExists = exports.getUrlParams = void 0; | ||
exports.tryAsync = exports.getFullPath = exports.fileExists = exports.getUrlParams = void 0; | ||
var fs = __importStar(require("fs")); | ||
@@ -95,2 +95,20 @@ var path = __importStar(require("path")); | ||
exports.getFullPath = getFullPath; | ||
function tryAsync(fn, module, requiredFor) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var err_2; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, fn()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
case 2: | ||
err_2 = _a.sent(); | ||
throw new Error("Package \"" + module + "\" is required for " + requiredFor + ". Please run \"npm i -D " + module + "\" and try again."); | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
exports.tryAsync = tryAsync; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "esbuild-plugin-vue3", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
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
48741
764