@salty-css/webpack 0.0.1-alpha.246 → 0.0.1-alpha.247
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/index.cjs +1 -1
- package/index.js +16 -16
- package/package.json +2 -2
package/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("path"),t=require("./index-C46X2dm-.cjs"),y=require("fs/promises"),g=require("fs"),p=async e=>{if(!e||e.includes("node_modules")||e.includes("saltygen"))return!1;if(e.includes("salty.config"))return!0;if(!t.isSaltyFile(e))return!1;const
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("path"),t=require("./index-C46X2dm-.cjs"),y=require("fs/promises"),g=require("fs"),p=async e=>{if(!e||e.includes("node_modules")||e.includes("saltygen"))return!1;if(e.includes("salty.config"))return!0;if(!t.isSaltyFile(e))return!1;const r=await y.readFile(e,"utf-8");return!!(/.+define[A-Z]\w+/.test(r)||/.+keyframes\(.+/.test(r))},c=(e,s,l=!1,r=!1)=>{var i,n,u;(n=(i=e.module)==null?void 0:i.rules)==null||n.push({test:t.saltyFileRegExp(),use:[{loader:d.resolve(__dirname,r?"./loader.cjs":"./loader.js"),options:{dir:s}}]}),l||(u=e.plugins)==null||u.push({apply:f=>{let o=!1;f.hooks.beforeCompile.tapPromise({name:"generateCss"},async()=>{o||(o=!0,await t.generateCss(s),g.watch(s,{recursive:!0},async(h,a)=>{await p(a)?await t.generateCss(s,!1,!1):t.isSaltyFile(a)&&await t.generateFile(s,a)}))})}})};exports.default=c;exports.saltyPlugin=c;
|
package/index.js
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
import { resolve as p } from "path";
|
2
|
-
import { i as f, s as
|
2
|
+
import { i as f, s as y, g as u, a as d } from "./index-C_rzJhGh.js";
|
3
3
|
import { readFile as g } from "fs/promises";
|
4
4
|
import { watch as m } from "fs";
|
5
|
-
const w = async (
|
6
|
-
if (!
|
7
|
-
if (
|
8
|
-
if (!f(
|
9
|
-
const t = await g(
|
10
|
-
return
|
11
|
-
},
|
5
|
+
const w = async (e) => {
|
6
|
+
if (!e || e.includes("node_modules") || e.includes("saltygen")) return !1;
|
7
|
+
if (e.includes("salty.config")) return !0;
|
8
|
+
if (!f(e)) return !1;
|
9
|
+
const t = await g(e, "utf-8");
|
10
|
+
return !!(/.+define[A-Z]\w+/.test(t) || /.+keyframes\(.+/.test(t));
|
11
|
+
}, _ = (e, s, r = !1, t = !1) => {
|
12
12
|
var l, o, i;
|
13
|
-
(o = (l =
|
14
|
-
test:
|
13
|
+
(o = (l = e.module) == null ? void 0 : l.rules) == null || o.push({
|
14
|
+
test: y(),
|
15
15
|
use: [
|
16
16
|
{
|
17
17
|
loader: p(__dirname, t ? "./loader.cjs" : "./loader.js"),
|
18
|
-
options: { dir:
|
18
|
+
options: { dir: s }
|
19
19
|
}
|
20
20
|
]
|
21
|
-
}), r || (i =
|
21
|
+
}), r || (i = e.plugins) == null || i.push({
|
22
22
|
apply: (c) => {
|
23
23
|
let n = !1;
|
24
24
|
c.hooks.beforeCompile.tapPromise({ name: "generateCss" }, async () => {
|
25
|
-
n || (n = !0, await u(
|
26
|
-
await w(a) ? await u(
|
25
|
+
n || (n = !0, await u(s), m(s, { recursive: !0 }, async (h, a) => {
|
26
|
+
await w(a) ? await u(s, !1, !1) : f(a) && await d(s, a);
|
27
27
|
}));
|
28
28
|
});
|
29
29
|
}
|
30
30
|
});
|
31
31
|
};
|
32
32
|
export {
|
33
|
-
|
34
|
-
|
33
|
+
_ as default,
|
34
|
+
_ as saltyPlugin
|
35
35
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salty-css/webpack",
|
3
|
-
"version": "0.0.1-alpha.
|
3
|
+
"version": "0.0.1-alpha.247",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@salty-css/core": "^0.0.1-alpha.
|
37
|
+
"@salty-css/core": "^0.0.1-alpha.247",
|
38
38
|
"webpack": ">=5.x"
|
39
39
|
}
|
40
40
|
}
|