Socket
Socket
Sign inDemoInstall

@unocss/vite

Package Overview
Dependencies
Maintainers
1
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/vite - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

49

dist/index.js

@@ -1453,2 +1453,5 @@ var __create = Object.create;

enforce: "pre",
buildStart() {
mainEntry = void 0;
},
configureServer(_server) {

@@ -1472,7 +1475,8 @@ server = _server;

mainEntry = id;
code = `
await import("${VIRTUAL_ENTRY}").then(() => fetch('${READY_CALLBACK}'));
${code}
`;
return code;
return {
code: `await import("${VIRTUAL_ENTRY}").then(() => fetch('${READY_CALLBACK}'));${code}`,
map: {
mappings: ""
}
};
}

@@ -1593,3 +1597,3 @@ return null;

var import_pluginutils5 = __toModule(require("@rollup/pluginutils"));
var VIRTUAL_ENTRY2 = "/@unocss/entry.css";
var VIRTUAL_ENTRY2 = "/@unocss-entry.css";
var PLACEHOLDER = "#--unocss--{--unocss:true}";

@@ -1599,2 +1603,3 @@ var PLACEHOLDER_RE = /#--unocss--\s*{\s*--unocss:\s*true;?\s*}/;

const filter = (0, import_pluginutils5.createFilter)(config.include || defaultInclude, config.exclude || defaultExclude);
let mainEntry;
const tasks = [];

@@ -1606,6 +1611,17 @@ return [

enforce: "pre",
buildStart() {
mainEntry = void 0;
},
transform(code, id) {
if (!filter(id))
return;
tasks.push(scan(code, id));
if (filter(id))
tasks.push(scan(code, id));
if (mainEntry === id || mainEntry == null && !id.includes("node_modules/vite") && !id.endsWith(".html") && id.startsWith("/")) {
mainEntry = id;
return {
code: `${code};import '${VIRTUAL_ENTRY2}';`,
map: {
mappings: ""
}
};
}
return null;

@@ -1620,9 +1636,2 @@ },

return PLACEHOLDER;
},
transformIndexHtml: {
enforce: "pre",
transform(code, { path }) {
tasks.push(scan(code, path));
return `${code}<script src="${VIRTUAL_ENTRY2}" type="module"><\/script>`;
}
}

@@ -1638,3 +1647,5 @@ },

async generateBundle(options, bundle) {
const keys = Object.keys(bundle).filter((i) => i.endsWith(".css"));
const files = Object.keys(bundle).filter((i) => i.endsWith(".css"));
if (!files.length)
return;
await Promise.all(tasks);

@@ -1645,4 +1656,4 @@ const { css } = await uno.generate(tokens);

return;
for (const key of keys) {
const chunk = bundle[key];
for (const file of files) {
const chunk = bundle[file];
if (chunk.type === "asset" && typeof chunk.source === "string") {

@@ -1649,0 +1660,0 @@ if (PLACEHOLDER_RE.test(chunk.source)) {

{
"name": "@unocss/vite",
"version": "0.1.3",
"description": "",
"keywords": [],
"homepage": "https://github.com/antfu/unocss#readme",
"bugs": {
"url": "https://github.com/antfu/unocss/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/antfu/unocss.git"
},
"funding": "https://github.com/sponsors/antfu",
"license": "MIT",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"sideEffects": false,
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@rollup/pluginutils": "^4.1.1",
"@unocss/config": "0.1.3",
"@unocss/core": "0.1.3",
"@unocss/scope": "0.1.3",
"nanoevents": "^6.0.2"
},
"devDependencies": {
"vite": "^2.6.12"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch src"
}
}
"name": "@unocss/vite",
"version": "0.1.4",
"description": "",
"keywords": [],
"homepage": "https://github.com/antfu/unocss#readme",
"bugs": {
"url": "https://github.com/antfu/unocss/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/antfu/unocss.git"
},
"funding": "https://github.com/sponsors/antfu",
"license": "MIT",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"sideEffects": false,
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@rollup/pluginutils": "^4.1.1",
"@unocss/config": "0.1.4",
"@unocss/core": "0.1.4",
"@unocss/scope": "0.1.4",
"nanoevents": "^6.0.2"
},
"devDependencies": {
"vite": "^2.6.12"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch src"
}
}

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