@salty-css/webpack 0.0.1-alpha.177 → 0.0.1-alpha.178

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