Socket
Socket
Sign inDemoInstall

@unocss/webpack

Package Overview
Dependencies
Maintainers
1
Versions
322
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/webpack - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

26

dist/index.js

@@ -10,4 +10,4 @@ var __create = Object.create;

__markAsModule(target);
for (var name2 in all)
__defProp(target, name2, { get: all[name2], enumerable: true });
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};

@@ -51,4 +51,4 @@ var __reExport = (target, module2, desc) => {

];
var PLACEHOLDER_RE = /(\\?")?#--unocss--\s*{\s*layer\s*:\s*(.+?);?\s*}/g;
var ALL_LAYERS = "__ALL__";
var LAYER_PLACEHOLDER_RE = /(\\?")?#--unocss--\s*{\s*layer\s*:\s*(.+?);?\s*}/g;
var LAYER_MARK_ALL = "__ALL__";
function resolveId(id) {

@@ -63,3 +63,3 @@ for (const alias of VIRTUAL_ENTRY_ALIAS) {

id: "/__uno.css",
layer: ALL_LAYERS
layer: LAYER_MARK_ALL
};

@@ -74,3 +74,4 @@ }

// src/index.ts
var name = "unocss:webpack";
var PLUGIN_NAME = "unocss:webpack";
var UPDATE_DEBOUNCE = 10;
function defineConfig(config) {

@@ -88,3 +89,2 @@ return config;

const entries = new Map();
const isDev = !!process.env.WEBPACK_DEV_SERVER || process.env.NODE_ENV === "development";
const plugin = {

@@ -114,4 +114,4 @@ name: "unocss:webpack",

webpack(compiler) {
compiler.hooks.compilation.tap(name, (compilation) => {
compilation.hooks.optimizeAssets.tapPromise(name, async () => {
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.optimizeAssets.tapPromise(PLUGIN_NAME, async () => {
const files = Object.keys(compilation.assets);

@@ -123,5 +123,5 @@ await Promise.all(tasks);

let replaced = false;
code = code.replace(PLACEHOLDER_RE, (_, quote, layer) => {
code = code.replace(LAYER_PLACEHOLDER_RE, (_, quote, layer) => {
replaced = true;
const css = layer === ALL_LAYERS ? result.getLayers(void 0, Array.from(entries.values())) : result.getLayer(layer) || "";
const css = layer === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries.values())) : result.getLayer(layer) || "";
if (!quote)

@@ -150,3 +150,3 @@ return css;

clearTimeout(timer);
timer = setTimeout(updateModules, 10);
timer = setTimeout(updateModules, UPDATE_DEBOUNCE);
}

@@ -162,3 +162,3 @@ async function updateModules() {

return;
const code = layer === ALL_LAYERS ? result.getLayers(void 0, Array.from(entries.values())) : result.getLayer(layer) || "";
const code = layer === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries.values())) : result.getLayer(layer) || "";
plugin.__vfs.writeModule(id, code);

@@ -165,0 +165,0 @@ });

{
"name": "@unocss/webpack",
"version": "0.9.1",
"version": "0.9.2",
"description": "The Webpack plugin for UnoCSS",

@@ -36,4 +36,4 @@ "keywords": [

"@rollup/pluginutils": "^4.1.1",
"@unocss/config": "0.9.1",
"@unocss/core": "0.9.1",
"@unocss/config": "0.9.2",
"@unocss/core": "0.9.2",
"unplugin": "^0.2.20",

@@ -40,0 +40,0 @@ "webpack-sources": "^3.2.1"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc