unplugin-essor 0.0.14 → 0.0.15-beta.1
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/README.md +37 -0
- package/dist/astro.cjs +12 -149
- package/dist/astro.cjs.map +1 -1
- package/dist/astro.d.cts +2 -7
- package/dist/astro.d.ts +1 -6
- package/dist/astro.js +6 -7
- package/dist/astro.js.map +1 -1
- package/dist/{chunk-VVPVCNL5.js → chunk-KCKAO6VH.js} +52 -46
- package/dist/chunk-KCKAO6VH.js.map +1 -0
- package/dist/chunk-KK7POSQ3.cjs +126 -0
- package/dist/chunk-KK7POSQ3.cjs.map +1 -0
- package/dist/esbuild.cjs +9 -124
- package/dist/esbuild.cjs.map +1 -1
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/farm.cjs +13 -0
- package/dist/farm.cjs.map +1 -0
- package/dist/farm.d.cts +6 -0
- package/dist/farm.d.ts +6 -0
- package/dist/farm.js +11 -0
- package/dist/farm.js.map +1 -0
- package/dist/index.cjs +10 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.js +3 -3
- package/dist/rolldown.cjs +13 -0
- package/dist/rolldown.cjs.map +1 -0
- package/dist/rolldown.d.cts +7 -0
- package/dist/rolldown.d.ts +7 -0
- package/dist/rolldown.js +11 -0
- package/dist/rolldown.js.map +1 -0
- package/dist/rollup.cjs +9 -124
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +9 -124
- package/dist/rspack.cjs.map +1 -1
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.js +1 -1
- package/dist/types.cjs +1 -19
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -1
- package/dist/types.d.ts +2 -1
- package/dist/vite.cjs +9 -124
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +9 -124
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +32 -13
- package/dist/chunk-VVPVCNL5.js.map +0 -1
package/dist/esbuild.cjs
CHANGED
|
@@ -1,128 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __export = (target, all) => {
|
|
23
|
-
for (var name in all)
|
|
24
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
-
};
|
|
26
|
-
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
-
for (let key of __getOwnPropNames(from))
|
|
29
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
-
}
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
-
mod
|
|
41
|
-
));
|
|
42
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkKK7POSQ3cjs = require('./chunk-KK7POSQ3.cjs');
|
|
43
4
|
|
|
44
5
|
// src/esbuild.ts
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
default: () => esbuild_default
|
|
48
|
-
});
|
|
49
|
-
module.exports = __toCommonJS(esbuild_exports);
|
|
50
|
-
var import_unplugin2 = require("unplugin");
|
|
6
|
+
var _unplugin = require('unplugin');
|
|
7
|
+
var esbuild_default = _unplugin.createEsbuildPlugin.call(void 0, _chunkKK7POSQ3cjs.unpluginFactory);
|
|
51
8
|
|
|
52
|
-
// src/index.ts
|
|
53
|
-
var import_unplugin = require("unplugin");
|
|
54
|
-
var babel = __toESM(require("@babel/core"), 1);
|
|
55
|
-
var import_babel_plugin_essor = __toESM(require("babel-plugin-essor"), 1);
|
|
56
|
-
var import_vite = require("vite");
|
|
57
|
-
var CSS_EXTENSIONS = [".css", ".scss", ".sass"];
|
|
58
|
-
var DEFAULT_OPTIONS = {
|
|
59
|
-
symbol: "$",
|
|
60
|
-
props: true,
|
|
61
|
-
server: false
|
|
62
|
-
};
|
|
63
|
-
var unpluginFactory = (options = {}) => {
|
|
64
|
-
const filter = (0, import_vite.createFilter)(options.include, options.exclude);
|
|
65
|
-
return {
|
|
66
|
-
name: "unplugin-essor",
|
|
67
|
-
// enforce: 'pre',
|
|
68
|
-
config() {
|
|
69
|
-
return {
|
|
70
|
-
esbuild: {
|
|
71
|
-
jsx: "preserve"
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
transform(code, id) {
|
|
76
|
-
if (["node_modules", "dist", "public"].some((p) => id.includes(p))) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (!filter(id) || !/.[cm]?[jt]sx?$/i.test(id)) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
const result = babel.transformSync(code, {
|
|
83
|
-
filename: id,
|
|
84
|
-
sourceMaps: true,
|
|
85
|
-
sourceType: "module",
|
|
86
|
-
plugins: [[import_babel_plugin_essor.default, __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options)]]
|
|
87
|
-
});
|
|
88
|
-
if (result == null ? void 0 : result.code) {
|
|
89
|
-
return {
|
|
90
|
-
code: result.code,
|
|
91
|
-
map: result.map
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return code;
|
|
95
|
-
},
|
|
96
|
-
handleHotUpdate(ctx) {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
for (const mod of ctx.modules) {
|
|
99
|
-
const deps = (_b = (_a = mod.info) == null ? void 0 : _a.meta) == null ? void 0 : _b.deps;
|
|
100
|
-
if (deps && deps.length > 0) {
|
|
101
|
-
for (const dep of deps) {
|
|
102
|
-
const mod2 = ctx.server.moduleGraph.getModuleById(dep);
|
|
103
|
-
if (mod2) {
|
|
104
|
-
ctx.server.moduleGraph.invalidateModule(mod2);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
} else if (mod.type === "js" && Array.from(mod.importers).every(
|
|
108
|
-
(m) => m.type === "css" || CSS_EXTENSIONS.some((ext) => {
|
|
109
|
-
var _a2;
|
|
110
|
-
return (_a2 = m.file) == null ? void 0 : _a2.endsWith(ext);
|
|
111
|
-
})
|
|
112
|
-
)) {
|
|
113
|
-
ctx.server.moduleGraph.invalidateAll();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (CSS_EXTENSIONS.some((ext) => ctx.file.endsWith(ext))) {
|
|
117
|
-
ctx.server.ws.send({
|
|
118
|
-
type: "full-reload"
|
|
119
|
-
});
|
|
120
|
-
return [];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
9
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
10
|
+
exports.default = esbuild_default;
|
|
11
|
+
|
|
12
|
+
module.exports = exports.default;
|
|
13
|
+
//# sourceMappingURL=esbuild.cjs.map
|
package/dist/esbuild.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/essor/essor/packages/unplugin/dist/esbuild.cjs","../src/esbuild.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAAA;AACA;AACA;ACJA,oCAAoC;AAGpC,IAAO,gBAAA,EAAQ,2CAAA,iCAAmC,CAAA;ADIlD;AACE;AACF,kCAAA","file":"/home/runner/work/essor/essor/packages/unplugin/dist/esbuild.cjs","sourcesContent":[null,"import { createEsbuildPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createEsbuildPlugin(unpluginFactory);\n"]}
|
package/dist/esbuild.d.cts
CHANGED
package/dist/esbuild.js
CHANGED
package/dist/farm.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkKK7POSQ3cjs = require('./chunk-KK7POSQ3.cjs');
|
|
4
|
+
|
|
5
|
+
// src/farm.ts
|
|
6
|
+
var _unplugin = require('unplugin');
|
|
7
|
+
var farm_default = _unplugin.createFarmPlugin.call(void 0, _chunkKK7POSQ3cjs.unpluginFactory);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = farm_default;
|
|
11
|
+
|
|
12
|
+
module.exports = exports.default;
|
|
13
|
+
//# sourceMappingURL=farm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/essor/essor/packages/unplugin/dist/farm.cjs","../src/farm.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAAA;AACA;AACA;ACJA,oCAAiC;AAGjC,IAAO,aAAA,EAAQ,wCAAA,iCAAgC,CAAA;ADI/C;AACE;AACF,+BAAA","file":"/home/runner/work/essor/essor/packages/unplugin/dist/farm.cjs","sourcesContent":[null,"import { createFarmPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createFarmPlugin(unpluginFactory);\n"]}
|
package/dist/farm.d.cts
ADDED
package/dist/farm.d.ts
ADDED
package/dist/farm.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-KCKAO6VH.js";
|
|
4
|
+
|
|
5
|
+
// src/farm.ts
|
|
6
|
+
import { createFarmPlugin } from "unplugin";
|
|
7
|
+
var farm_default = createFarmPlugin(unpluginFactory);
|
|
8
|
+
export {
|
|
9
|
+
farm_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=farm.js.map
|
package/dist/farm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createFarmPlugin(unpluginFactory);\n"],"mappings":";;;;;AAAA,SAAS,wBAAwB;AAGjC,IAAO,eAAQ,iBAAiB,eAAe;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,131 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __export = (target, all) => {
|
|
23
|
-
for (var name in all)
|
|
24
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
-
};
|
|
26
|
-
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
-
for (let key of __getOwnPropNames(from))
|
|
29
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
-
}
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
-
mod
|
|
41
|
-
));
|
|
42
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
43
2
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var babel = __toESM(require("@babel/core"), 1);
|
|
54
|
-
var import_babel_plugin_essor = __toESM(require("babel-plugin-essor"), 1);
|
|
55
|
-
var import_vite = require("vite");
|
|
56
|
-
var CSS_EXTENSIONS = [".css", ".scss", ".sass"];
|
|
57
|
-
var DEFAULT_OPTIONS = {
|
|
58
|
-
symbol: "$",
|
|
59
|
-
props: true,
|
|
60
|
-
server: false
|
|
61
|
-
};
|
|
62
|
-
var unpluginFactory = (options = {}) => {
|
|
63
|
-
const filter = (0, import_vite.createFilter)(options.include, options.exclude);
|
|
64
|
-
return {
|
|
65
|
-
name: "unplugin-essor",
|
|
66
|
-
// enforce: 'pre',
|
|
67
|
-
config() {
|
|
68
|
-
return {
|
|
69
|
-
esbuild: {
|
|
70
|
-
jsx: "preserve"
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
transform(code, id) {
|
|
75
|
-
if (["node_modules", "dist", "public"].some((p) => id.includes(p))) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (!filter(id) || !/.[cm]?[jt]sx?$/i.test(id)) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
const result = babel.transformSync(code, {
|
|
82
|
-
filename: id,
|
|
83
|
-
sourceMaps: true,
|
|
84
|
-
sourceType: "module",
|
|
85
|
-
plugins: [[import_babel_plugin_essor.default, __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options)]]
|
|
86
|
-
});
|
|
87
|
-
if (result == null ? void 0 : result.code) {
|
|
88
|
-
return {
|
|
89
|
-
code: result.code,
|
|
90
|
-
map: result.map
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return code;
|
|
94
|
-
},
|
|
95
|
-
handleHotUpdate(ctx) {
|
|
96
|
-
var _a, _b;
|
|
97
|
-
for (const mod of ctx.modules) {
|
|
98
|
-
const deps = (_b = (_a = mod.info) == null ? void 0 : _a.meta) == null ? void 0 : _b.deps;
|
|
99
|
-
if (deps && deps.length > 0) {
|
|
100
|
-
for (const dep of deps) {
|
|
101
|
-
const mod2 = ctx.server.moduleGraph.getModuleById(dep);
|
|
102
|
-
if (mod2) {
|
|
103
|
-
ctx.server.moduleGraph.invalidateModule(mod2);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} else if (mod.type === "js" && Array.from(mod.importers).every(
|
|
107
|
-
(m) => m.type === "css" || CSS_EXTENSIONS.some((ext) => {
|
|
108
|
-
var _a2;
|
|
109
|
-
return (_a2 = m.file) == null ? void 0 : _a2.endsWith(ext);
|
|
110
|
-
})
|
|
111
|
-
)) {
|
|
112
|
-
ctx.server.moduleGraph.invalidateAll();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (CSS_EXTENSIONS.some((ext) => ctx.file.endsWith(ext))) {
|
|
116
|
-
ctx.server.ws.send({
|
|
117
|
-
type: "full-reload"
|
|
118
|
-
});
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
var unplugin = /* @__PURE__ */ (0, import_unplugin.createUnplugin)(unpluginFactory);
|
|
125
|
-
var src_default = unplugin;
|
|
126
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
-
0 && (module.exports = {
|
|
128
|
-
unplugin,
|
|
129
|
-
unpluginFactory
|
|
130
|
-
});
|
|
131
|
-
//# sourceMappingURL=index.cjs.mapexports.default = module.exports;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkKK7POSQ3cjs = require('./chunk-KK7POSQ3.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = _chunkKK7POSQ3cjs.index_default; exports.unplugin = _chunkKK7POSQ3cjs.unplugin; exports.unpluginFactory = _chunkKK7POSQ3cjs.unpluginFactory;
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/essor/essor/packages/unplugin/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,8JAAC","file":"/home/runner/work/essor/essor/packages/unplugin/dist/index.cjs"}
|
package/dist/index.d.cts
CHANGED
|
@@ -6,4 +6,6 @@ import 'vite';
|
|
|
6
6
|
declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
7
7
|
declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export = unplugin;
|
|
11
|
+
export { unplugin, unpluginFactory };
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkKK7POSQ3cjs = require('./chunk-KK7POSQ3.cjs');
|
|
4
|
+
|
|
5
|
+
// src/rolldown.ts
|
|
6
|
+
var _unplugin = require('unplugin');
|
|
7
|
+
var rolldown_default = _unplugin.createRolldownPlugin.call(void 0, _chunkKK7POSQ3cjs.unpluginFactory);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = rolldown_default;
|
|
11
|
+
|
|
12
|
+
module.exports = exports.default;
|
|
13
|
+
//# sourceMappingURL=rolldown.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/essor/essor/packages/unplugin/dist/rolldown.cjs","../src/rolldown.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAAA;AACA;AACA;ACJA,oCAAqC;AAGrC,IAAO,iBAAA,EAAQ,4CAAA,iCAAoC,CAAA;ADInD;AACE;AACF,mCAAA","file":"/home/runner/work/essor/essor/packages/unplugin/dist/rolldown.cjs","sourcesContent":[null,"import { createRolldownPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createRolldownPlugin(unpluginFactory);\n"]}
|
package/dist/rolldown.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-KCKAO6VH.js";
|
|
4
|
+
|
|
5
|
+
// src/rolldown.ts
|
|
6
|
+
import { createRolldownPlugin } from "unplugin";
|
|
7
|
+
var rolldown_default = createRolldownPlugin(unpluginFactory);
|
|
8
|
+
export {
|
|
9
|
+
rolldown_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=rolldown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rolldown.ts"],"sourcesContent":["import { createRolldownPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createRolldownPlugin(unpluginFactory);\n"],"mappings":";;;;;AAAA,SAAS,4BAA4B;AAGrC,IAAO,mBAAQ,qBAAqB,eAAe;","names":[]}
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,128 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __export = (target, all) => {
|
|
23
|
-
for (var name in all)
|
|
24
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
-
};
|
|
26
|
-
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
-
for (let key of __getOwnPropNames(from))
|
|
29
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
-
}
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
-
mod
|
|
41
|
-
));
|
|
42
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkKK7POSQ3cjs = require('./chunk-KK7POSQ3.cjs');
|
|
43
4
|
|
|
44
5
|
// src/rollup.ts
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
default: () => rollup_default
|
|
48
|
-
});
|
|
49
|
-
module.exports = __toCommonJS(rollup_exports);
|
|
50
|
-
var import_unplugin2 = require("unplugin");
|
|
6
|
+
var _unplugin = require('unplugin');
|
|
7
|
+
var rollup_default = _unplugin.createRollupPlugin.call(void 0, _chunkKK7POSQ3cjs.unpluginFactory);
|
|
51
8
|
|
|
52
|
-
// src/index.ts
|
|
53
|
-
var import_unplugin = require("unplugin");
|
|
54
|
-
var babel = __toESM(require("@babel/core"), 1);
|
|
55
|
-
var import_babel_plugin_essor = __toESM(require("babel-plugin-essor"), 1);
|
|
56
|
-
var import_vite = require("vite");
|
|
57
|
-
var CSS_EXTENSIONS = [".css", ".scss", ".sass"];
|
|
58
|
-
var DEFAULT_OPTIONS = {
|
|
59
|
-
symbol: "$",
|
|
60
|
-
props: true,
|
|
61
|
-
server: false
|
|
62
|
-
};
|
|
63
|
-
var unpluginFactory = (options = {}) => {
|
|
64
|
-
const filter = (0, import_vite.createFilter)(options.include, options.exclude);
|
|
65
|
-
return {
|
|
66
|
-
name: "unplugin-essor",
|
|
67
|
-
// enforce: 'pre',
|
|
68
|
-
config() {
|
|
69
|
-
return {
|
|
70
|
-
esbuild: {
|
|
71
|
-
jsx: "preserve"
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
transform(code, id) {
|
|
76
|
-
if (["node_modules", "dist", "public"].some((p) => id.includes(p))) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (!filter(id) || !/.[cm]?[jt]sx?$/i.test(id)) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
const result = babel.transformSync(code, {
|
|
83
|
-
filename: id,
|
|
84
|
-
sourceMaps: true,
|
|
85
|
-
sourceType: "module",
|
|
86
|
-
plugins: [[import_babel_plugin_essor.default, __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options)]]
|
|
87
|
-
});
|
|
88
|
-
if (result == null ? void 0 : result.code) {
|
|
89
|
-
return {
|
|
90
|
-
code: result.code,
|
|
91
|
-
map: result.map
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return code;
|
|
95
|
-
},
|
|
96
|
-
handleHotUpdate(ctx) {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
for (const mod of ctx.modules) {
|
|
99
|
-
const deps = (_b = (_a = mod.info) == null ? void 0 : _a.meta) == null ? void 0 : _b.deps;
|
|
100
|
-
if (deps && deps.length > 0) {
|
|
101
|
-
for (const dep of deps) {
|
|
102
|
-
const mod2 = ctx.server.moduleGraph.getModuleById(dep);
|
|
103
|
-
if (mod2) {
|
|
104
|
-
ctx.server.moduleGraph.invalidateModule(mod2);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
} else if (mod.type === "js" && Array.from(mod.importers).every(
|
|
108
|
-
(m) => m.type === "css" || CSS_EXTENSIONS.some((ext) => {
|
|
109
|
-
var _a2;
|
|
110
|
-
return (_a2 = m.file) == null ? void 0 : _a2.endsWith(ext);
|
|
111
|
-
})
|
|
112
|
-
)) {
|
|
113
|
-
ctx.server.moduleGraph.invalidateAll();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (CSS_EXTENSIONS.some((ext) => ctx.file.endsWith(ext))) {
|
|
117
|
-
ctx.server.ws.send({
|
|
118
|
-
type: "full-reload"
|
|
119
|
-
});
|
|
120
|
-
return [];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
9
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
10
|
+
exports.default = rollup_default;
|
|
11
|
+
|
|
12
|
+
module.exports = exports.default;
|
|
13
|
+
//# sourceMappingURL=rollup.cjs.map
|
package/dist/rollup.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/essor/essor/packages/unplugin/dist/rollup.cjs","../src/rollup.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAAA;AACA;AACA;ACJA,oCAAmC;AAGnC,IAAO,eAAA,EAAQ,0CAAA,iCAAkC,CAAA;ADIjD;AACE;AACF,iCAAA","file":"/home/runner/work/essor/essor/packages/unplugin/dist/rollup.cjs","sourcesContent":[null,"import { createRollupPlugin } from 'unplugin';\nimport { unpluginFactory } from '.';\n\nexport default createRollupPlugin(unpluginFactory);\n"]}
|
package/dist/rollup.d.cts
CHANGED