@plumeria/unplugin 10.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vite.js ADDED
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const unplugin_1 = require("unplugin");
37
+ const core_1 = require("./core");
38
+ const path = __importStar(require("path"));
39
+ const disk_css_1 = require("./disk-css");
40
+ function attachViteHooks(plugin, options) {
41
+ let devServer;
42
+ const { cssLookup, cssFileLookup, targets, setDev, setRoot } = plugin.__plumeriaInternal;
43
+ const useDiskEmit = options?.devEmitToDisk ?? false;
44
+ let isDev = false;
45
+ let viteRoot = process.cwd();
46
+ const virtualCssPath = useDiskEmit ? (0, disk_css_1.resolveVirtualCssPath)() : '';
47
+ const baseTransform = plugin.transform;
48
+ plugin.transform = async function (code, id) {
49
+ const result = await baseTransform.call(this, code, id);
50
+ if (isDev &&
51
+ useDiskEmit &&
52
+ result &&
53
+ typeof result === 'object' &&
54
+ result.code) {
55
+ result.code = result.code.replace(/import\s+["'](\/[^"']+\.zero\.css)["'];/g, (_match, cssPath) => {
56
+ const absolutePath = cssFileLookup.get(cssPath);
57
+ if (!absolutePath)
58
+ return _match;
59
+ const cssContent = cssLookup.get(absolutePath);
60
+ if (cssContent == null)
61
+ return _match;
62
+ (0, disk_css_1.ensureVirtualCssFile)(virtualCssPath);
63
+ const filePathKey = path
64
+ .relative(viteRoot, absolutePath)
65
+ .replace(/\\/g, '/');
66
+ (0, disk_css_1.writeCssBlock)(virtualCssPath, filePathKey, cssContent);
67
+ const importPath = (0, disk_css_1.rewriteImportPath)(id, virtualCssPath);
68
+ return `import "${importPath}";`;
69
+ });
70
+ }
71
+ else if (!useDiskEmit &&
72
+ devServer &&
73
+ result &&
74
+ typeof result === 'object' &&
75
+ result.code.includes('.zero.css')) {
76
+ const baseId = id.replace(core_1.EXTENSION_PATTERN, '');
77
+ const cssFilename = `${baseId}.zero.css`;
78
+ const mod = devServer.moduleGraph.getModuleById(cssFilename);
79
+ if (mod) {
80
+ devServer.reloadModule(mod);
81
+ }
82
+ }
83
+ return result;
84
+ };
85
+ const vitePlugin = {
86
+ ...plugin,
87
+ name: '@plumeria/unplugin:vite',
88
+ config(userConfig, { command }) {
89
+ if (command === 'build') {
90
+ const build = userConfig.build || {};
91
+ build.cssCodeSplit = false;
92
+ return { build };
93
+ }
94
+ },
95
+ configResolved(config) {
96
+ viteRoot = config.root;
97
+ setRoot(config.root);
98
+ if (config.command === 'serve') {
99
+ isDev = true;
100
+ setDev(true);
101
+ }
102
+ },
103
+ configureServer(server) {
104
+ devServer = server;
105
+ },
106
+ handleHotUpdate(ctx) {
107
+ if (!devServer)
108
+ return;
109
+ const modules = [...ctx.modules];
110
+ if (!ctx.file.includes('node_modules')) {
111
+ const affectedProviders = targets
112
+ .filter((t) => t.id !== ctx.file)
113
+ .map((t) => devServer.moduleGraph.getModuleById(t.id))
114
+ .filter((m) => !!m);
115
+ affectedProviders.forEach((p) => {
116
+ if (!modules.includes(p)) {
117
+ modules.push(p);
118
+ }
119
+ });
120
+ }
121
+ return modules;
122
+ },
123
+ };
124
+ if (!useDiskEmit) {
125
+ vitePlugin.resolveId = function (importeeUrl) {
126
+ const [id] = importeeUrl.split('?', 1);
127
+ if (cssLookup.has(id)) {
128
+ return id;
129
+ }
130
+ const resolved = cssFileLookup.get(id);
131
+ if (resolved) {
132
+ return resolved;
133
+ }
134
+ return null;
135
+ };
136
+ vitePlugin.load = function (url) {
137
+ const [id] = url.split('?', 1);
138
+ return cssLookup.get(id) ?? null;
139
+ };
140
+ }
141
+ return vitePlugin;
142
+ }
143
+ exports.default = (0, unplugin_1.createVitePlugin)((options, metaOptions) => attachViteHooks((0, core_1.unpluginFactory)(options, metaOptions), options));
package/dist/vite.mjs ADDED
@@ -0,0 +1,108 @@
1
+ import { createVitePlugin } from 'unplugin';
2
+ import { unpluginFactory, EXTENSION_PATTERN } from './core.mjs';
3
+ import * as path from 'path';
4
+ import { resolveVirtualCssPath, ensureVirtualCssFile, writeCssBlock, rewriteImportPath, } from './disk-css.mjs';
5
+ function attachViteHooks(plugin, options) {
6
+ let devServer;
7
+ const { cssLookup, cssFileLookup, targets, setDev, setRoot } = plugin.__plumeriaInternal;
8
+ const useDiskEmit = options?.devEmitToDisk ?? false;
9
+ let isDev = false;
10
+ let viteRoot = process.cwd();
11
+ const virtualCssPath = useDiskEmit ? resolveVirtualCssPath() : '';
12
+ const baseTransform = plugin.transform;
13
+ plugin.transform = async function (code, id) {
14
+ const result = await baseTransform.call(this, code, id);
15
+ if (isDev &&
16
+ useDiskEmit &&
17
+ result &&
18
+ typeof result === 'object' &&
19
+ result.code) {
20
+ result.code = result.code.replace(/import\s+["'](\/[^"']+\.zero\.css)["'];/g, (_match, cssPath) => {
21
+ const absolutePath = cssFileLookup.get(cssPath);
22
+ if (!absolutePath)
23
+ return _match;
24
+ const cssContent = cssLookup.get(absolutePath);
25
+ if (cssContent == null)
26
+ return _match;
27
+ ensureVirtualCssFile(virtualCssPath);
28
+ const filePathKey = path
29
+ .relative(viteRoot, absolutePath)
30
+ .replace(/\\/g, '/');
31
+ writeCssBlock(virtualCssPath, filePathKey, cssContent);
32
+ const importPath = rewriteImportPath(id, virtualCssPath);
33
+ return `import "${importPath}";`;
34
+ });
35
+ }
36
+ else if (!useDiskEmit &&
37
+ devServer &&
38
+ result &&
39
+ typeof result === 'object' &&
40
+ result.code.includes('.zero.css')) {
41
+ const baseId = id.replace(EXTENSION_PATTERN, '');
42
+ const cssFilename = `${baseId}.zero.css`;
43
+ const mod = devServer.moduleGraph.getModuleById(cssFilename);
44
+ if (mod) {
45
+ devServer.reloadModule(mod);
46
+ }
47
+ }
48
+ return result;
49
+ };
50
+ const vitePlugin = {
51
+ ...plugin,
52
+ name: '@plumeria/unplugin:vite',
53
+ config(userConfig, { command }) {
54
+ if (command === 'build') {
55
+ const build = userConfig.build || {};
56
+ build.cssCodeSplit = false;
57
+ return { build };
58
+ }
59
+ },
60
+ configResolved(config) {
61
+ viteRoot = config.root;
62
+ setRoot(config.root);
63
+ if (config.command === 'serve') {
64
+ isDev = true;
65
+ setDev(true);
66
+ }
67
+ },
68
+ configureServer(server) {
69
+ devServer = server;
70
+ },
71
+ handleHotUpdate(ctx) {
72
+ if (!devServer)
73
+ return;
74
+ const modules = [...ctx.modules];
75
+ if (!ctx.file.includes('node_modules')) {
76
+ const affectedProviders = targets
77
+ .filter((t) => t.id !== ctx.file)
78
+ .map((t) => devServer.moduleGraph.getModuleById(t.id))
79
+ .filter((m) => !!m);
80
+ affectedProviders.forEach((p) => {
81
+ if (!modules.includes(p)) {
82
+ modules.push(p);
83
+ }
84
+ });
85
+ }
86
+ return modules;
87
+ },
88
+ };
89
+ if (!useDiskEmit) {
90
+ vitePlugin.resolveId = function (importeeUrl) {
91
+ const [id] = importeeUrl.split('?', 1);
92
+ if (cssLookup.has(id)) {
93
+ return id;
94
+ }
95
+ const resolved = cssFileLookup.get(id);
96
+ if (resolved) {
97
+ return resolved;
98
+ }
99
+ return null;
100
+ };
101
+ vitePlugin.load = function (url) {
102
+ const [id] = url.split('?', 1);
103
+ return cssLookup.get(id) ?? null;
104
+ };
105
+ }
106
+ return vitePlugin;
107
+ }
108
+ export default createVitePlugin((options, metaOptions) => attachViteHooks(unpluginFactory(options, metaOptions), options));
@@ -0,0 +1,4 @@
1
+ import { type PluginOptions } from './core';
2
+ export declare function attachWebpackHooks(plugin: any): any;
3
+ declare const _default: (options?: PluginOptions | undefined) => import("unplugin").WebpackPluginInstance;
4
+ export default _default;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.attachWebpackHooks = attachWebpackHooks;
37
+ const unplugin_1 = require("unplugin");
38
+ const core_1 = require("./core");
39
+ const path = __importStar(require("path"));
40
+ const ZERO_CSS_SUFFIX = '(?:$|\\?|%3F)';
41
+ const VIRTUAL_CSS_PATH = new RegExp(`\\.zero\\.css${ZERO_CSS_SUFFIX}`);
42
+ function attachWebpackHooks(plugin) {
43
+ const { setDev, setRoot } = plugin.__plumeriaInternal;
44
+ plugin.transformInclude = (id) => {
45
+ const [pathId] = id.split('?', 1);
46
+ return (/\.(ts|tsx|js|jsx)$/.test(pathId) &&
47
+ !pathId.includes('node_modules') &&
48
+ !pathId.endsWith('.html'));
49
+ };
50
+ plugin.loadInclude = (id) => {
51
+ const [pathId] = id.split('?', 1);
52
+ return pathId.endsWith('.zero.css');
53
+ };
54
+ const originalTransform = plugin.transform;
55
+ plugin.transform = async function (code, id) {
56
+ const result = await originalTransform.call(this, code, id);
57
+ if (result && typeof result === 'object' && result.code) {
58
+ const { cssFileLookup } = plugin.__plumeriaInternal;
59
+ result.code = result.code.replace(/import\s+"(\/[^"]+\.zero\.css)";/g, (_match, cssPath) => {
60
+ const absoluteCssPath = cssFileLookup.get(cssPath);
61
+ if (!absoluteCssPath)
62
+ return _match;
63
+ let rel = path
64
+ .relative(path.dirname(id), absoluteCssPath)
65
+ .replace(/\\/g, '/');
66
+ if (!rel.startsWith('.'))
67
+ rel = `./${rel}`;
68
+ return `import "${rel}?t=${Date.now()}";`;
69
+ });
70
+ }
71
+ return result;
72
+ };
73
+ plugin.resolveId = function (id, importer) {
74
+ const [pathId, query] = id.split('?');
75
+ const { cssLookup } = plugin.__plumeriaInternal;
76
+ if (pathId.endsWith('.zero.css')) {
77
+ let resolvedAbsolute = null;
78
+ if (cssLookup.has(pathId)) {
79
+ resolvedAbsolute = pathId;
80
+ }
81
+ else if (importer) {
82
+ const resolved = path
83
+ .resolve(path.dirname(importer), pathId)
84
+ .replace(/\\/g, '/');
85
+ if (cssLookup.has(resolved)) {
86
+ resolvedAbsolute = resolved;
87
+ }
88
+ }
89
+ if (resolvedAbsolute) {
90
+ return query ? `${resolvedAbsolute}?${query}` : resolvedAbsolute;
91
+ }
92
+ }
93
+ return null;
94
+ };
95
+ plugin.load = function (id) {
96
+ const [pathId] = id.split('?', 1);
97
+ const { cssLookup, targets } = plugin.__plumeriaInternal;
98
+ const sourceTarget = targets.find((t) => `${t.id.replace(/\.(ts|tsx|js|jsx)$/, '')}.zero.css` === pathId);
99
+ if (sourceTarget && typeof this.addDependency === 'function') {
100
+ this.addDependency(sourceTarget.id);
101
+ }
102
+ const css = cssLookup.get(pathId);
103
+ if (css == null)
104
+ return null;
105
+ return { code: css, moduleType: 'css' };
106
+ };
107
+ const hookFn = (compiler) => {
108
+ if (compiler.isChild())
109
+ return;
110
+ setRoot(compiler.context);
111
+ if (compiler.options.mode === 'development') {
112
+ setDev(true);
113
+ }
114
+ const rules = compiler.options.module?.rules;
115
+ if (rules && Array.isArray(rules)) {
116
+ const cssRule = rules.find((rule) => rule &&
117
+ rule.test &&
118
+ rule.test instanceof RegExp &&
119
+ rule.test.test('test.css'));
120
+ if (cssRule) {
121
+ rules.unshift({
122
+ ...cssRule,
123
+ test: VIRTUAL_CSS_PATH,
124
+ type: 'css/auto',
125
+ enforce: 'pre',
126
+ });
127
+ }
128
+ else {
129
+ for (let i = 0; i < rules.length; i++) {
130
+ const rule = rules[i];
131
+ if (rule &&
132
+ rule.type === 'javascript/auto' &&
133
+ Array.isArray(rule.use) &&
134
+ rule.use.some((u) => u?.loader && String(u.loader).includes('load.mjs'))) {
135
+ const origInclude = rule.include;
136
+ rule.include = (id) => {
137
+ if (VIRTUAL_CSS_PATH.test(id))
138
+ return false;
139
+ return typeof origInclude === 'function' ? origInclude(id) : true;
140
+ };
141
+ rules.unshift({
142
+ include: (id) => {
143
+ if (!VIRTUAL_CSS_PATH.test(id))
144
+ return false;
145
+ return typeof origInclude === 'function'
146
+ ? origInclude(id)
147
+ : true;
148
+ },
149
+ enforce: rule.enforce,
150
+ use: rule.use,
151
+ type: 'css/auto',
152
+ });
153
+ break;
154
+ }
155
+ }
156
+ }
157
+ }
158
+ };
159
+ return {
160
+ ...plugin,
161
+ webpack: hookFn,
162
+ rspack: hookFn,
163
+ };
164
+ }
165
+ exports.default = (0, unplugin_1.createWebpackPlugin)((options, meta) => {
166
+ return attachWebpackHooks((0, core_1.unpluginFactory)(options, meta));
167
+ });
@@ -0,0 +1,131 @@
1
+ import { createWebpackPlugin } from 'unplugin';
2
+ import { unpluginFactory } from './core.mjs';
3
+ import * as path from 'path';
4
+ const ZERO_CSS_SUFFIX = '(?:$|\\?|%3F)';
5
+ const VIRTUAL_CSS_PATH = new RegExp(`\\.zero\\.css${ZERO_CSS_SUFFIX}`);
6
+ export function attachWebpackHooks(plugin) {
7
+ const { setDev, setRoot } = plugin.__plumeriaInternal;
8
+ plugin.transformInclude = (id) => {
9
+ const [pathId] = id.split('?', 1);
10
+ return (/\.(ts|tsx|js|jsx)$/.test(pathId) &&
11
+ !pathId.includes('node_modules') &&
12
+ !pathId.endsWith('.html'));
13
+ };
14
+ plugin.loadInclude = (id) => {
15
+ const [pathId] = id.split('?', 1);
16
+ return pathId.endsWith('.zero.css');
17
+ };
18
+ const originalTransform = plugin.transform;
19
+ plugin.transform = async function (code, id) {
20
+ const result = await originalTransform.call(this, code, id);
21
+ if (result && typeof result === 'object' && result.code) {
22
+ const { cssFileLookup } = plugin.__plumeriaInternal;
23
+ result.code = result.code.replace(/import\s+"(\/[^"]+\.zero\.css)";/g, (_match, cssPath) => {
24
+ const absoluteCssPath = cssFileLookup.get(cssPath);
25
+ if (!absoluteCssPath)
26
+ return _match;
27
+ let rel = path
28
+ .relative(path.dirname(id), absoluteCssPath)
29
+ .replace(/\\/g, '/');
30
+ if (!rel.startsWith('.'))
31
+ rel = `./${rel}`;
32
+ return `import "${rel}?t=${Date.now()}";`;
33
+ });
34
+ }
35
+ return result;
36
+ };
37
+ plugin.resolveId = function (id, importer) {
38
+ const [pathId, query] = id.split('?');
39
+ const { cssLookup } = plugin.__plumeriaInternal;
40
+ if (pathId.endsWith('.zero.css')) {
41
+ let resolvedAbsolute = null;
42
+ if (cssLookup.has(pathId)) {
43
+ resolvedAbsolute = pathId;
44
+ }
45
+ else if (importer) {
46
+ const resolved = path
47
+ .resolve(path.dirname(importer), pathId)
48
+ .replace(/\\/g, '/');
49
+ if (cssLookup.has(resolved)) {
50
+ resolvedAbsolute = resolved;
51
+ }
52
+ }
53
+ if (resolvedAbsolute) {
54
+ return query ? `${resolvedAbsolute}?${query}` : resolvedAbsolute;
55
+ }
56
+ }
57
+ return null;
58
+ };
59
+ plugin.load = function (id) {
60
+ const [pathId] = id.split('?', 1);
61
+ const { cssLookup, targets } = plugin.__plumeriaInternal;
62
+ const sourceTarget = targets.find((t) => `${t.id.replace(/\.(ts|tsx|js|jsx)$/, '')}.zero.css` === pathId);
63
+ if (sourceTarget && typeof this.addDependency === 'function') {
64
+ this.addDependency(sourceTarget.id);
65
+ }
66
+ const css = cssLookup.get(pathId);
67
+ if (css == null)
68
+ return null;
69
+ return { code: css, moduleType: 'css' };
70
+ };
71
+ const hookFn = (compiler) => {
72
+ if (compiler.isChild())
73
+ return;
74
+ setRoot(compiler.context);
75
+ if (compiler.options.mode === 'development') {
76
+ setDev(true);
77
+ }
78
+ const rules = compiler.options.module?.rules;
79
+ if (rules && Array.isArray(rules)) {
80
+ const cssRule = rules.find((rule) => rule &&
81
+ rule.test &&
82
+ rule.test instanceof RegExp &&
83
+ rule.test.test('test.css'));
84
+ if (cssRule) {
85
+ rules.unshift({
86
+ ...cssRule,
87
+ test: VIRTUAL_CSS_PATH,
88
+ type: 'css/auto',
89
+ enforce: 'pre',
90
+ });
91
+ }
92
+ else {
93
+ for (let i = 0; i < rules.length; i++) {
94
+ const rule = rules[i];
95
+ if (rule &&
96
+ rule.type === 'javascript/auto' &&
97
+ Array.isArray(rule.use) &&
98
+ rule.use.some((u) => u?.loader && String(u.loader).includes('load.mjs'))) {
99
+ const origInclude = rule.include;
100
+ rule.include = (id) => {
101
+ if (VIRTUAL_CSS_PATH.test(id))
102
+ return false;
103
+ return typeof origInclude === 'function' ? origInclude(id) : true;
104
+ };
105
+ rules.unshift({
106
+ include: (id) => {
107
+ if (!VIRTUAL_CSS_PATH.test(id))
108
+ return false;
109
+ return typeof origInclude === 'function'
110
+ ? origInclude(id)
111
+ : true;
112
+ },
113
+ enforce: rule.enforce,
114
+ use: rule.use,
115
+ type: 'css/auto',
116
+ });
117
+ break;
118
+ }
119
+ }
120
+ }
121
+ }
122
+ };
123
+ return {
124
+ ...plugin,
125
+ webpack: hookFn,
126
+ rspack: hookFn,
127
+ };
128
+ }
129
+ export default createWebpackPlugin((options, meta) => {
130
+ return attachWebpackHooks(unpluginFactory(options, meta));
131
+ });
package/package.json ADDED
@@ -0,0 +1,105 @@
1
+ {
2
+ "name": "@plumeria/unplugin",
3
+ "version": "10.5.3",
4
+ "description": "Universal Plumeria plugin for various build tools",
5
+ "author": "Refirst 11",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/zss-in-js/plumeria.git",
10
+ "directory": "packages/unplugin"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/zss-in-js/plumeria/issues"
14
+ },
15
+ "keywords": [
16
+ "plumeria",
17
+ "css",
18
+ "unplugin",
19
+ "vite",
20
+ "webpack",
21
+ "rspack",
22
+ "esbuild",
23
+ "farm",
24
+ "rollup",
25
+ "rolldown",
26
+ "bun"
27
+ ],
28
+ "main": "dist/index.js",
29
+ "module": "dist/index.mjs",
30
+ "types": "dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.js"
36
+ },
37
+ "./vite": {
38
+ "types": "./dist/vite.d.ts",
39
+ "import": "./dist/vite.mjs",
40
+ "require": "./dist/vite.js"
41
+ },
42
+ "./webpack": {
43
+ "types": "./dist/webpack.d.ts",
44
+ "import": "./dist/webpack.mjs",
45
+ "require": "./dist/webpack.js"
46
+ },
47
+ "./rspack": {
48
+ "types": "./dist/rspack.d.ts",
49
+ "import": "./dist/rspack.mjs",
50
+ "require": "./dist/rspack.js"
51
+ },
52
+ "./esbuild": {
53
+ "types": "./dist/esbuild.d.ts",
54
+ "import": "./dist/esbuild.mjs",
55
+ "require": "./dist/esbuild.js"
56
+ },
57
+ "./farm": {
58
+ "types": "./dist/farm.d.ts",
59
+ "import": "./dist/farm.mjs",
60
+ "require": "./dist/farm.js"
61
+ },
62
+ "./rollup": {
63
+ "types": "./dist/rollup.d.ts",
64
+ "import": "./dist/rollup.mjs",
65
+ "require": "./dist/rollup.js"
66
+ },
67
+ "./rolldown": {
68
+ "types": "./dist/rolldown.d.ts",
69
+ "import": "./dist/rolldown.mjs",
70
+ "require": "./dist/rolldown.js"
71
+ },
72
+ "./unloader": {
73
+ "types": "./dist/unloader.d.ts",
74
+ "import": "./dist/unloader.mjs",
75
+ "require": "./dist/unloader.js"
76
+ },
77
+ "./bun": {
78
+ "types": "./dist/bun.d.ts",
79
+ "import": "./dist/bun.mjs",
80
+ "require": "./dist/bun.js"
81
+ }
82
+ },
83
+ "files": [
84
+ "dist/",
85
+ "zero-virtual.css"
86
+ ],
87
+ "scripts": {
88
+ "build": "rimraf dist && pnpm esm && pnpm cjs",
89
+ "cjs": "tsc --project tsconfig.cjs.json",
90
+ "esm": "tsc --project tsconfig.esm.json && node mjs-extension.ts"
91
+ },
92
+ "dependencies": {
93
+ "@plumeria/utils": "workspace:^",
94
+ "unplugin": "^3.0.0"
95
+ },
96
+ "devDependencies": {
97
+ "@swc/core": "catalog:",
98
+ "zss-engine": "catalog:",
99
+ "@rollup/pluginutils": "^5.1.0",
100
+ "vite": "^7.1.1"
101
+ },
102
+ "publishConfig": {
103
+ "access": "public"
104
+ }
105
+ }
@@ -0,0 +1 @@
1
+ /** Placeholder file */