windicss-webpack-plugin
Advanced tools
Comparing version 0.5.1 to 0.5.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pitch = void 0; | ||
const constants_1 = require("../constants"); | ||
const isTemplateLoader = (l) => /(\/|\\|@)transform-template/.test(l.path); | ||
const postCSSLoader = (l) => /(\/|\\|@)postcss-loader/.test(l.path); | ||
const cssLoader = (l) => /(\/|\\|@)css-loader/.test(l.path); | ||
const isPitcherLoader = (l) => `${constants_1.NAME}:pitcher` === l.ident; | ||
const pitch = function (remainingRequest) { | ||
// remove the pitcher immediately | ||
this.loaders.splice(0, 1); | ||
const pitcherLoaderIndex = this.loaders.findIndex(isPitcherLoader); | ||
if (pitcherLoaderIndex !== -1) { | ||
this.loaders.splice(pitcherLoaderIndex, 1); | ||
} | ||
/* | ||
@@ -11,0 +16,0 @@ * Move the position of the transform-template loader for Vue SFCs. |
@@ -19,7 +19,14 @@ "use strict"; | ||
try { | ||
// avoid duplicate scanning on HMR | ||
if (service.scanned && service.options.enableScan) { | ||
service.options.enableScan = false; | ||
} | ||
const css = await service.generateCSS(); | ||
css.replace('(boot)', '(generated)'); | ||
callback(null, source + '\n' + css); | ||
} | ||
catch (e) { | ||
callback(e, source + '\n' + `/* Error: ${JSON.stringify(e, null, 2)}*/`); | ||
const error = JSON.stringify(e, null, 2); | ||
this.emitError(`[Windi CSS] Failed to generate CSS. Error: ${error}`); | ||
callback(e, source + '\n' + `/* Error: ${error}*/`); | ||
} | ||
@@ -60,3 +67,3 @@ }; | ||
try { | ||
service.extractFile(content.data, content.id, service.options.transformGroups); | ||
await service.extractFile(content.data, content.id, service.options.transformGroups); | ||
} | ||
@@ -63,0 +70,0 @@ catch (e) { |
{ | ||
"name": "windicss-webpack-plugin", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": { |
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
30411
516