@salty-css/webpack 0.0.1 → 0.1.0-alpha.0
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 +1 -1
- package/loader.cjs +1 -1
- package/loader.js +16 -5
- package/package.json +10 -2
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/salty-compiler"),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
|
@@ -2,7 +2,7 @@ import { resolve as u } from "path";
|
|
|
2
2
|
import { checkShouldRestart as f } from "@salty-css/core/server";
|
|
3
3
|
import { watch as c } from "fs";
|
|
4
4
|
import { saltyFileRegExp as y, isSaltyFile as d } from "@salty-css/core/compiler/helpers";
|
|
5
|
-
import { SaltyCompiler as h } from "@salty-css/core/compiler/
|
|
5
|
+
import { SaltyCompiler as h } from "@salty-css/core/compiler/salty-compiler";
|
|
6
6
|
const k = (s, e, m = !1, n = !1) => {
|
|
7
7
|
var a, l, r;
|
|
8
8
|
const t = new h(e);
|
package/loader.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var i=Object.create;var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var u=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!w.call(t,o)&&o!==r&&s(t,o,{get:()=>e[o],enumerable:!(a=l(e,o))||a.enumerable});return t};var d=(t,e,r)=>(r=t!=null?i(m(t)):{},u(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t));const f=require("@salty-css/core/compiler/salty-compiler"),n=new WeakMap,c=new Map,h=async t=>{if(t==="react"||t===void 0)return(await import("@salty-css/react/transform-salty-file")).transformSaltyFile;throw new Error(`@salty-css/webpack: framework "${t}" is not supported. Supported: react.`)},g=t=>{let e=c.get(t);return e||(e=new f.SaltyCompiler(t),c.set(t,e)),e},y=t=>{let e=n.get(t);return e||(e=t.getFramework().then(h),n.set(t,e)),e};async function C(){const{dir:t}=this.getOptions(),{resourcePath:e}=this,r=g(t);return await r.generateFile(e),await(await y(r))(r,e)}module.exports=C;
|
package/loader.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { SaltyCompiler as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { SaltyCompiler as n } from "@salty-css/core/compiler/salty-compiler";
|
|
2
|
+
const o = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new Map(), s = async (t) => {
|
|
3
|
+
if (t === "react" || t === void 0)
|
|
4
|
+
return (await import("@salty-css/react/transform-salty-file")).transformSaltyFile;
|
|
5
|
+
throw new Error(`@salty-css/webpack: framework "${t}" is not supported. Supported: react.`);
|
|
6
|
+
}, c = (t) => {
|
|
7
|
+
let e = a.get(t);
|
|
8
|
+
return e || (e = new n(t), a.set(t, e)), e;
|
|
9
|
+
}, i = (t) => {
|
|
10
|
+
let e = o.get(t);
|
|
11
|
+
return e || (e = t.getFramework().then(s), o.set(t, e)), e;
|
|
12
|
+
};
|
|
13
|
+
async function p() {
|
|
14
|
+
const { dir: t } = this.getOptions(), { resourcePath: e } = this, r = c(t);
|
|
15
|
+
return await r.generateFile(e), await (await i(r))(r, e);
|
|
5
16
|
}
|
|
6
17
|
export {
|
|
7
|
-
|
|
18
|
+
p as default
|
|
8
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salty-css/webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -34,7 +34,15 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@salty-css/core": "^0.0.
|
|
37
|
+
"@salty-css/core": "^0.1.0-alpha.0",
|
|
38
38
|
"webpack": ">=5.x"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@salty-css/react": "^0.0.1"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"@salty-css/react": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
39
47
|
}
|
|
40
48
|
}
|