@salty-css/webpack 0.0.1-alpha.153 → 0.0.1-alpha.154

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