@salty-css/webpack 0.0.1-alpha.310 → 0.0.1-alpha.311

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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("path"),s=require("@salty-css/core/compiler"),y=require("@salty-css/core/server"),d=require("fs"),i=(a,e,n=!1,c=!1)=>{var l,r,o;(r=(l=a.module)==null?void 0:l.rules)==null||r.push({test:s.saltyFileRegExp(),use:[{loader:f.resolve(__dirname,c?"./loader.cjs":"./loader.js"),options:{dir:e}}]}),n||(o=a.plugins)==null||o.push({apply:p=>{let u=!1;p.hooks.beforeCompile.tapPromise({name:"generateCss"},async()=>{u||(u=!0,await s.generateCss(e),d.watch(e,{recursive:!0},async(g,t)=>{await y.checkShouldRestart(t)?await s.generateCss(e,!1,!1):s.isSaltyFile(t)&&await s.generateFile(e,t)}))})}})};exports.default=i;exports.saltyPlugin=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("path"),f=require("@salty-css/core/server"),g=require("fs"),u=require("@salty-css/core/compiler/helpers"),h=require("@salty-css/core/compiler/as-class"),n=(t,e,c=!1,p=!1)=>{var a,l,r;const s=new h.SaltyCompiler(e);(l=(a=t.module)==null?void 0:a.rules)==null||l.push({test:u.saltyFileRegExp(),use:[{loader:d.resolve(__dirname,p?"./loader.cjs":"./loader.js"),options:{dir:e}}]}),c||(r=t.plugins)==null||r.push({apply:y=>{let o=!1;y.hooks.beforeCompile.tapPromise({name:"generateCss"},async()=>{o||(o=!0,await s.generateCss(),g.watch(e,{recursive:!0},async(m,i)=>{await f.checkShouldRestart(i)?await s.generateCss():u.isSaltyFile(i)&&await s.generateFile(e)}))})}})};exports.default=n;exports.saltyPlugin=n;
package/index.js CHANGED
@@ -1,23 +1,25 @@
1
- import { resolve as m } from "path";
2
- import { saltyFileRegExp as f, generateCss as i, isSaltyFile as c, generateFile as y } from "@salty-css/core/compiler";
3
- import { checkShouldRestart as d } from "@salty-css/core/server";
4
- import { watch as h } from "fs";
5
- const k = (t, e, u = !1, n = !1) => {
6
- var a, l, o;
7
- (l = (a = t.module) == null ? void 0 : a.rules) == null || l.push({
8
- test: f(),
1
+ import { resolve as u } from "path";
2
+ import { checkShouldRestart as f } from "@salty-css/core/server";
3
+ import { watch as c } from "fs";
4
+ import { saltyFileRegExp as y, isSaltyFile as d } from "@salty-css/core/compiler/helpers";
5
+ import { SaltyCompiler as h } from "@salty-css/core/compiler/as-class";
6
+ const k = (s, e, m = !1, n = !1) => {
7
+ var a, l, r;
8
+ const t = new h(e);
9
+ (l = (a = s.module) == null ? void 0 : a.rules) == null || l.push({
10
+ test: y(),
9
11
  use: [
10
12
  {
11
- loader: m(__dirname, n ? "./loader.cjs" : "./loader.js"),
13
+ loader: u(__dirname, n ? "./loader.cjs" : "./loader.js"),
12
14
  options: { dir: e }
13
15
  }
14
16
  ]
15
- }), u || (o = t.plugins) == null || o.push({
17
+ }), m || (r = s.plugins) == null || r.push({
16
18
  apply: (p) => {
17
- let r = !1;
19
+ let o = !1;
18
20
  p.hooks.beforeCompile.tapPromise({ name: "generateCss" }, async () => {
19
- r || (r = !0, await i(e), h(e, { recursive: !0 }, async (g, s) => {
20
- await d(s) ? await i(e, !1, !1) : c(s) && await y(e, s);
21
+ o || (o = !0, await t.generateCss(), c(e, { recursive: !0 }, async (g, i) => {
22
+ await f(i) ? await t.generateCss() : d(i) && await t.generateFile(e);
21
23
  }));
22
24
  });
23
25
  }
package/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("@salty-css/core/compiler");async function r(){const{dir:e}=this.getOptions(),{resourcePath:t}=this;return await i.generateFile(e,t),await i.minimizeFile(e,t)}module.exports=r;
1
+ "use strict";const s=require("@salty-css/core/compiler/as-class");async function r(){const{dir:i}=this.getOptions(),{resourcePath:t}=this,e=new s.SaltyCompiler(i);return await e.generateFile(t),await e.minimizeFile(t)}module.exports=r;
package/loader.js CHANGED
@@ -1,8 +1,8 @@
1
- import { generateFile as i, minimizeFile as a } from "@salty-css/core/compiler";
2
- async function n() {
3
- const { dir: t } = this.getOptions(), { resourcePath: e } = this;
4
- return await i(t, e), await a(t, e);
1
+ import { SaltyCompiler as a } from "@salty-css/core/compiler/as-class";
2
+ async function r() {
3
+ const { dir: i } = this.getOptions(), { resourcePath: t } = this, e = new a(i);
4
+ return await e.generateFile(t), await e.minimizeFile(t);
5
5
  }
6
6
  export {
7
- n as default
7
+ r as default
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/webpack",
3
- "version": "0.0.1-alpha.310",
3
+ "version": "0.0.1-alpha.311",
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.310",
37
+ "@salty-css/core": "^0.0.1-alpha.311",
38
38
  "webpack": ">=5.x"
39
39
  }
40
40
  }