@salty-css/webpack 0.0.1-alpha.155 → 0.0.1-alpha.157
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 +23 -25
- 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
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("path"),o=require("./index-a4KtTJRO.cjs"),y=require("fs/promises"),f=async e=>{if(e.includes("salty.config"))return!0;if(!o.isSaltyFile(e))return!1;const n=await y.readFile(e,"utf-8");return!!/.+define[A-Z]\w+/.test(n)},d=(e,t,r=!1,n=!1)=>{var l,i,u;(i=(l=e.module)==null?void 0:l.rules)==null||i.push({test:o.saltyFileRegExp(),use:[{loader:p.resolve(__dirname,n?"./loader.cjs":"./loader.js"),options:{dir:t}}]}),r||(u=e.plugins)==null||u.push({apply:h=>{h.hooks.watchRun.tapPromise({name:"generateCss"},async a=>{console.log("generateCss"),await o.generateCss(t),a.hooks.emit.tapPromise({name:"generateCssInner"},async s=>{console.log("generateCssInner")}),a.hooks.invalid.tap({name:"generateCssInner"},async s=>{if(console.log("compiler.hooks.invalid"),!s)return;const c=await f(s);console.log("shouldRestart",{shouldRestart:c,file:s}),c&&(()=>{var g;console.log("restarting"),(g=a.watching)==null||g.invalidate()})()})})}})};exports.default=d;exports.saltyPlugin=d;
|
package/index.js
CHANGED
@@ -1,34 +1,32 @@
|
|
1
|
-
import { resolve as
|
2
|
-
import { i as
|
3
|
-
import { readFile as
|
1
|
+
import { resolve as d } from "path";
|
2
|
+
import { i as f, s as p, g as h } from "./index-jvM0uSOz.js";
|
3
|
+
import { readFile as m } from "fs/promises";
|
4
4
|
const y = async (s) => {
|
5
5
|
if (s.includes("salty.config")) return !0;
|
6
|
-
if (!
|
7
|
-
const
|
8
|
-
return !!/.+define[A-Z]\w+/.test(
|
9
|
-
},
|
10
|
-
var i, l
|
11
|
-
(
|
12
|
-
test:
|
6
|
+
if (!f(s)) return !1;
|
7
|
+
const a = await m(s, "utf-8");
|
8
|
+
return !!/.+define[A-Z]\w+/.test(a);
|
9
|
+
}, v = (s, t, n = !1, a = !1) => {
|
10
|
+
var r, i, l;
|
11
|
+
(i = (r = s.module) == null ? void 0 : r.rules) == null || i.push({
|
12
|
+
test: p(),
|
13
13
|
use: [
|
14
14
|
{
|
15
|
-
loader:
|
15
|
+
loader: d(__dirname, a ? "./loader.cjs" : "./loader.js"),
|
16
16
|
options: { dir: t }
|
17
17
|
}
|
18
18
|
]
|
19
|
-
}),
|
20
|
-
apply: (
|
21
|
-
|
22
|
-
console.log("generateCss"), await
|
19
|
+
}), n || (l = s.plugins) == null || l.push({
|
20
|
+
apply: (g) => {
|
21
|
+
g.hooks.watchRun.tapPromise({ name: "generateCss" }, async (o) => {
|
22
|
+
console.log("generateCss"), await h(t), o.hooks.emit.tapPromise({ name: "generateCssInner" }, async (e) => {
|
23
23
|
console.log("generateCssInner");
|
24
|
-
})
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
var g;
|
31
|
-
console.log("restarting"), (g = a.watching) == null || g.invalidate();
|
24
|
+
}), o.hooks.invalid.tap({ name: "generateCssInner" }, async (e) => {
|
25
|
+
if (console.log("compiler.hooks.invalid"), !e) return;
|
26
|
+
const c = await y(e);
|
27
|
+
console.log("shouldRestart", { shouldRestart: c, file: e }), c && (() => {
|
28
|
+
var u;
|
29
|
+
console.log("restarting"), (u = o.watching) == null || u.invalidate();
|
32
30
|
})();
|
33
31
|
});
|
34
32
|
});
|
@@ -36,6 +34,6 @@ const y = async (s) => {
|
|
36
34
|
});
|
37
35
|
};
|
38
36
|
export {
|
39
|
-
|
40
|
-
|
37
|
+
v as default,
|
38
|
+
v as saltyPlugin
|
41
39
|
};
|
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.157",
|
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.157",
|
38
38
|
"webpack": ">=5.x"
|
39
39
|
}
|
40
40
|
}
|