@devup-ui/webpack-plugin 0.1.10 → 0.1.12

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@devup-ui/wasm"),t=function(){this.callback(null,e.getCss())};exports.default=t;
@@ -0,0 +1,4 @@
1
+ import { RawLoaderDefinitionFunction } from 'webpack';
2
+ declare const devupUICssLoader: RawLoaderDefinitionFunction;
3
+ export default devupUICssLoader;
4
+ //# sourceMappingURL=css-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-loader.d.ts","sourceRoot":"","sources":["../src/css-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,QAAA,MAAM,gBAAgB,EAAE,2BAEvB,CAAA;AACD,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { getCss as s } from "@devup-ui/wasm";
2
+ const o = function() {
3
+ this.callback(null, s());
4
+ };
5
+ export {
6
+ o as default
7
+ };
@@ -0,0 +1,4 @@
1
+ :root{--base:#FFFFFF;--warning:#FF9800;--third:#918AE9;--menuActive:#EAE8FC;--info:#2196F3;--joinBg:#CDE2FA;--shadow:#87878740;--buttonBlueHover:#1453AC;--menuHover:#F6F4FF;--containerBackground:#FFFFFF;--primary:#6159D4;--error:#F44336;--background:#FFFFFF;--link:#006BFF;--footerTitle:#A3A4B4;--search:#9C50FF;--textReverse:#FFFFFF;--title:#1A1A1A;--success:#4CAF50;--border:#E0E0E0;--negativeBase:#000000;--codeBg:#3E3B41;--buttonBlue:#266CCD;--cardBg:#F8F8F8;--secondary:#85A5F2;--buttonBlueActive:#19498B;--footerBg:#E6E7ED;--caption:#A9A8B4;--footerText:#51575F;--text:#2F2F2F;--captionBold:#878594;}
2
+ :root[data-theme=dark]{--text:#EDEDED;--base:#000000;--border:#333333;--error:#F44336;--footerTitle:#A3A4B4;--shadow:#62626240;--third:#737FE4;--link:#006BFF;--caption:#A9A8B4;--textReverse:#2F2F2F;--containerBackground:#1E1E1E;--search:#6FA4FF;--warning:#FF9800;--cardBg:#28272B;--title:#FAFAFA;--success:#4CAF50;--buttonBlueHover:#1453AC;--background:#131313;--joinBg:#2F363E;--footerText:#FFFFFF;--captionBold:#878594;--codeBg:#2E303C;--footerBg:#2E303C;--primary:#737FE4;--menuActive:#283259;--secondary:#2A4586;--menuHover:#3C404B;--buttonBlueActive:#19498B;--negativeBase:#FFFFFF;--buttonBlue:#0867AF;--info:#2196F3;}
3
+ .typo-body{font-family:Pretendard;font-size:14px;font-weight:500;line-height:130%;letter-spacing:-0.42px}.typo-bodyReg{font-family:Pretendard;font-size:16px;font-weight:400;line-height:150%;letter-spacing:-0.48px}.typo-buttonL{font-family:Pretendard;font-size:17px;font-weight:800;line-height:130%;letter-spacing:-0.51px}.typo-buttonLbold{font-family:Pretendard;font-size:17px;font-weight:700;line-height:130%;letter-spacing:-0.51px}.typo-buttonLsemiB{font-family:Pretendard;font-size:17px;font-weight:600;line-height:130%;letter-spacing:-0.51px}.typo-buttonM{font-family:Pretendard;font-size:15px;font-weight:600;line-height:130%;letter-spacing:-0.45px}.typo-buttonS{font-family:Pretendard;font-size:14px;font-weight:800;line-height:130%;letter-spacing:-0.42px}.typo-buttonSmid{font-family:Pretendard;font-size:14px;font-weight:500;line-height:130%;letter-spacing:-0.42px}.typo-caption{font-family:Pretendard;font-size:14px;font-weight:500;line-height:140%;letter-spacing:-0.42px}.typo-captionBold{font-family:Pretendard;font-size:14px;font-weight:700;line-height:130%;letter-spacing:-0.42px}.typo-code{font-family:D2Coding;font-size:13px;font-weight:700;line-height:150%;letter-spacing:-0.39px}.typo-footerMenu{font-family:Pretendard;font-size:13px;font-weight:500;line-height:140%;letter-spacing:-0.39px}.typo-h1{font-family:Pretendard;font-size:38px;font-weight:800;line-height:130%;letter-spacing:-1.14px}.typo-h2{font-family:Pretendard;font-size:36px;font-weight:800;line-height:130%;letter-spacing:-1.08px}.typo-h3{font-family:Pretendard;font-size:32px;font-weight:700;line-height:130%;letter-spacing:-0.96px}.typo-h4{font-family:Pretendard;font-size:28px;font-weight:700;line-height:130%;letter-spacing:-0.84px}.typo-h5{font-family:Pretendard;font-size:24px;font-weight:600;line-height:130%;letter-spacing:-0.72px}.typo-h6{font-family:Pretendard;font-size:18px;font-weight:600;line-height:130%;letter-spacing:-0.54px}.typo-h6Reg{font-family:Pretendard;font-size:18px;font-weight:400;line-height:130%;letter-spacing:-0.54px}.typo-small{font-family:Pretendard;font-size:11px;font-weight:300;line-height:130%;letter-spacing:-0.33px}.typo-smallBold{font-family:Pretendard;font-size:12px;font-weight:800;line-height:140%;letter-spacing:-0.36px}.typo-textL{font-family:Pretendard;font-size:16px;font-weight:500;line-height:130%;letter-spacing:-0.48px}.typo-textS{font-family:Pretendard;font-size:13px;font-weight:500;line-height:140%;letter-spacing:-0.39px}.typo-textSbold{font-family:Pretendard;font-size:15px;font-weight:700;line-height:140%;letter-spacing:-0.45px}
4
+ @media (min-width:1280px){.typo-body{font-family:Pretendard;font-size:16px;font-weight:500;line-height:150%;letter-spacing:-0.48px}.typo-buttonL{font-family:Pretendard;font-size:20px;font-weight:800;line-height:130%;letter-spacing:-0.6px}.typo-buttonLbold{font-family:Pretendard;font-size:18px;font-weight:700;line-height:130%;letter-spacing:-0.54px}.typo-buttonLsemiB{font-family:Pretendard;font-size:18px;font-weight:600;line-height:130%;letter-spacing:-0.54px}.typo-buttonM{font-family:Pretendard;font-size:17px;font-weight:600;line-height:130%;letter-spacing:-0.51px}.typo-buttonS{font-family:Pretendard;font-size:15px;font-weight:700;line-height:130%;letter-spacing:-0.45px}.typo-buttonSmid{font-family:Pretendard;font-size:15px;font-weight:500;line-height:130%;letter-spacing:-0.45px}.typo-code{font-family:D2Coding;font-size:15px;font-weight:700;line-height:150%;letter-spacing:-0.45px}.typo-footerMenu{font-family:Pretendard;font-size:14px;font-weight:500;line-height:140%;letter-spacing:-0.42px}.typo-h1{font-family:Pretendard;font-size:52px;font-weight:800;line-height:130%;letter-spacing:-1.56px}.typo-h2{font-family:Pretendard;font-size:48px;font-weight:800;line-height:130%;letter-spacing:-1.44px}.typo-h3{font-family:Pretendard;font-size:42px;font-weight:700;line-height:130%;letter-spacing:-1.26px}.typo-h4{font-family:Pretendard;font-size:36px;font-weight:700;line-height:130%;letter-spacing:-1.08px}.typo-h5{font-family:Pretendard;font-size:30px;font-weight:600;line-height:130%;letter-spacing:-0.9px}.typo-h6{font-family:Pretendard;font-size:24px;font-weight:600;line-height:130%;letter-spacing:-0.72px}.typo-h6Reg{font-family:Pretendard;font-size:24px;font-weight:400;line-height:130%;letter-spacing:-0.72px}.typo-small{font-family:Pretendard;font-size:12px;font-weight:400;line-height:140%;letter-spacing:-0.36px}.typo-textL{font-family:Pretendard;font-size:18px;font-weight:500;line-height:150%;letter-spacing:-0.54px}.typo-textS{font-family:Pretendard;font-size:15px;font-weight:500;line-height:140%;letter-spacing:-0.45px}}.d18{width:247px}.d60{padding:12px 34px}.d65{padding:20px 30px}.d66{background:var(--buttonBlue)}.d3{text-align:center}.d67{margin-left:auto}.d78{border-radius:16px}.d77{padding-left:10px;padding-right:10px;}.d50{max-width:1440px}.d0{height:50px}.d25{gap:16px}.d80{height:70px}.d83{top:20px}.d75{height:42px}.d1{width:52px}.d41{color:var(--footerText)}.d45{align-items:flex-end}.d2{color:var(--title)}.d24{padding-top:80px}.d63{width:520px}.d68{padding-right:100px}.d37{padding-top:40px}.d57{height:46px}.d70{justify-content:center}.d28{padding-left:8px;padding-right:8px;}.d34{padding:30px 24px}.d36{padding-bottom:120px}.d56{box-shadow:0px 0px 8px 0px rgba(0, 0, 0, 0.25)}.d30{width:484px}.d71{background-color:var(--joinBg)}.d12{width:24px;height:24px;}.d54{width:100%}.d44{justify-content:space-between}.d79{box-shadow:0px 2px 8px 0px var(--shadow, rgba(135, 135, 135, 0.25))}.d14{background:var(--text)}.d21{margin-left:auto;margin-right:auto;}.d6{align-items:center}.d55{background:var(--containerBackground)}.d61{opacity:2.4px}.d82{position:fixed}.d17{padding:16px 40px}.d5{flex-direction:column}.d39{margin-top:150px}.d49{padding:60px 320px}.d53{padding:20px}.d19{gap:50px}.d31{background:var(--cardBg)}.d38{padding-top:40px;padding-bottom:40px;}.d64{background:var(--codeBg)}.d76{padding-left:24px;padding-right:24px;}.d35{gap:40px}.d15{border-radius:100px}.d13{gap:10px}.d47{background:var(--footerBg)}.d7{gap:24px}.d40{color:var(--footerTitle)}.d48{gap:80px}.d22{max-width:1200px}.d59{border-radius:1000px}.d26{width:805px}.d46{text-align:right}.d72{background-image:url(/discord-bg.svg)}.d32{border-radius:20px}.d9{border-radius:100%}.d58{width:162.67px}.d20{max-width:800px}.d29{flex:1 0 0}.d62{padding:6px}.d42{gap:14px}.d81{padding-left:40px;padding-right:40px;}.d8{background:var(--secondary)}.d16{gap:20px}.d52{flex:4px}.d23{padding-bottom:100px}.d33{padding:24px}.d27{width:32px;height:32px;}.d73{border-radius:40px 40px 0px 40px}.d4{display:flex}.d43{min-width:240px}.d69{width:548px}.d74{height:380px}.d11{color:var(--base)}.d51{color:#FFF}.d10{width:10px;height:10px;}
package/dist/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("node:fs"),a=require("@devup-ui/wasm"),l=function(c){const{plugin:n}=this.getOptions(),{package:r,cssFile:o}=n.options,e=this.async(),t=this.resourcePath;if(t.includes("node_modules/")||t.includes("@devup-ui/react")||!/\.[tj](s|sx)?$/.test(t)){e(null,c);return}try{const{code:s,css:i}=a.codeExtract(this.resourcePath,c.toString(),r,o+(n.watch?"?"+Date.now():""));i&&u.writeFileSync(o,i,{encoding:"utf-8"}),e(null,s)}catch(s){e(s)}};exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("node:fs"),a=require("@devup-ui/wasm"),d=function(n){const{plugin:o}=this.getOptions(),{package:r,cssFile:e}=o.options,t=this.async(),s=this.resourcePath;if(s.includes("node_modules/")||s.includes("@devup-ui/react")||!/\.[tj](s|sx)?$/.test(s)){t(null,n);return}this.addDependency(e);try{const{code:c,css:i}=a.codeExtract(this.resourcePath,n.toString(),r,e+(o.watch?"?"+Date.now():""));i&&u.writeFileSync(e,i,{encoding:"utf-8"}),t(null,c)}catch(c){t(c)}};exports.default=d;
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,oBAAoB,CAAA;CAC7B;AAED,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAiClE,CAAA;AACH,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,oBAAoB,CAAA;CAC7B;AAED,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAmClE,CAAA;AACH,eAAe,aAAa,CAAA"}
package/dist/loader.js CHANGED
@@ -1,23 +1,24 @@
1
1
  import { writeFileSync as a } from "node:fs";
2
- import { codeExtract as u } from "@devup-ui/wasm";
3
- const p = function(o) {
4
- const { plugin: s } = this.getOptions(), { package: r, cssFile: n } = s.options, t = this.async(), e = this.resourcePath;
5
- if (e.includes("node_modules/") || e.includes("@devup-ui/react") || !/\.[tj](s|sx)?$/.test(e)) {
6
- t(null, o);
2
+ import { codeExtract as d } from "@devup-ui/wasm";
3
+ const p = function(s) {
4
+ const { plugin: o } = this.getOptions(), { package: r, cssFile: t } = o.options, e = this.async(), c = this.resourcePath;
5
+ if (c.includes("node_modules/") || c.includes("@devup-ui/react") || !/\.[tj](s|sx)?$/.test(c)) {
6
+ e(null, s);
7
7
  return;
8
8
  }
9
+ this.addDependency(t);
9
10
  try {
10
- const { code: c, css: i } = u(
11
+ const { code: n, css: i } = d(
11
12
  this.resourcePath,
12
- o.toString(),
13
+ s.toString(),
13
14
  r,
14
- n + (s.watch ? "?" + Date.now() : "")
15
+ t + (o.watch ? "?" + Date.now() : "")
15
16
  );
16
- i && a(n, i, {
17
+ i && a(t, i, {
17
18
  encoding: "utf-8"
18
- }), t(null, c);
19
- } catch (c) {
20
- t(c);
19
+ }), e(null, n);
20
+ } catch (n) {
21
+ e(n);
21
22
  }
22
23
  };
23
24
  export {
package/dist/plugin.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var m=(s,e,t)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>m(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),g=require("node:module"),u=require("node:path"),v=require("node:url"),c=require("@devup-ui/wasm");var n=typeof document<"u"?document.currentScript:null;const y=v.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("plugin.cjs",document.baseURI).href),P=u.dirname(y);class S{constructor({package:e="@devup-ui/react",cssFile:t=u.join(P,"devup-ui.css"),devupPath:r="devup.json",interfacePath:o=".df"}){a(this,"options");a(this,"watch",!1);this.options={package:e,cssFile:t,devupPath:r,interfacePath:o}}writeDataFiles(){var t;c.registerTheme((t=JSON.parse(i.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:t.theme);const e=c.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography");e&&(i.existsSync(this.options.interfacePath)||i.mkdirSync(this.options.interfacePath),i.writeFileSync(u.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"})),i.writeFileSync(this.options.cssFile,c.getCss(),{encoding:"utf-8"})}apply(e){const t=i.existsSync(this.options.devupPath);if(t){try{this.writeDataFiles()}catch(o){console.error(o)}e.hooks.afterCompile.tap("DevupUIWebpackPlugin",o=>{o.fileDependencies.add(this.options.devupPath)})}let r=null;e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin",(o,h)=>{this.watch=!0,t&&i.stat(this.options.devupPath,(p,l)=>{if(p){console.error(`Error checking ${this.options.devupPath}:`,p);return}const d=l.mtimeMs;r&&r!==d&&this.writeDataFiles(),r=d}),h()}),i.existsSync(this.options.cssFile)||i.writeFileSync(this.options.cssFile,"",{encoding:"utf-8"}),e.options.module.rules.push({test:/\.(tsx|ts|js|mjs|jsx)$/,exclude:/node_modules/,use:[{loader:g.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/loader"),options:{plugin:this}}]})}}exports.DevupUIWebpackPlugin=S;
1
+ "use strict";var m=Object.defineProperty;var g=(o,e,t)=>e in o?m(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>g(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),l=require("node:module"),c=require("node:path"),v=require("node:url"),u=require("@devup-ui/wasm");var s=typeof document<"u"?document.currentScript:null;const y=v.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:s&&s.tagName.toUpperCase()==="SCRIPT"&&s.src||new URL("plugin.cjs",document.baseURI).href),P=c.dirname(y);class U{constructor({package:e="@devup-ui/react",cssFile:t=c.join(P,"devup-ui.css"),devupPath:r="devup.json",interfacePath:n=".df"}){a(this,"options");a(this,"watch",!1);this.options={package:e,cssFile:t,devupPath:r,interfacePath:n}}writeDataFiles(){var t;u.registerTheme((t=JSON.parse(i.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:t.theme);const e=u.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography");e&&(i.existsSync(this.options.interfacePath)||i.mkdirSync(this.options.interfacePath),i.writeFileSync(c.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"})),i.writeFileSync(this.options.cssFile,u.getCss(),{encoding:"utf-8"})}apply(e){const t=i.existsSync(this.options.devupPath);if(t){try{this.writeDataFiles()}catch(n){console.error(n)}e.hooks.afterCompile.tap("DevupUIWebpackPlugin",n=>{n.fileDependencies.add(this.options.devupPath)})}let r=null;e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin",(n,h)=>{this.watch=!0,t&&i.stat(this.options.devupPath,(p,f)=>{if(p){console.error(`Error checking ${this.options.devupPath}:`,p);return}const d=f.mtimeMs;r&&r!==d&&this.writeDataFiles(),r=d}),h()}),i.existsSync(this.options.cssFile)||i.writeFileSync(this.options.cssFile,"",{encoding:"utf-8"}),e.options.module.rules.push({test:this.options.cssFile,use:[{loader:l.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:s&&s.tagName.toUpperCase()==="SCRIPT"&&s.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/css-loader")}]}),e.options.module.rules.push({test:/\.(tsx|ts|js|mjs|jsx)$/,exclude:/node_modules/,use:[{loader:l.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:s&&s.tagName.toUpperCase()==="SCRIPT"&&s.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/loader"),options:{plugin:this}}]})}}exports.DevupUIWebpackPlugin=U;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;IACpC,KAAK,UAAQ;gBAED,EACV,OAAO,EAAE,UAA8B,EACvC,OAAwC,EACxC,SAAwB,EACxB,aAAqB,GACtB,EAAE,OAAO,CAAC,2BAA2B,CAAC;IASvC,cAAc;IAyBd,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAqDzB"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;IACpC,KAAK,UAAQ;gBAED,EACV,OAAO,EAAE,UAA8B,EACvC,OAAwC,EACxC,SAAwB,EACxB,aAAqB,GACtB,EAAE,OAAO,CAAC,2BAA2B,CAAC;IASvC,cAAc;IAyBd,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAiEzB"}
package/dist/plugin.js CHANGED
@@ -1,12 +1,12 @@
1
- var d = Object.defineProperty;
2
- var m = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var n = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { readFileSync as f, existsSync as p, mkdirSync as g, writeFileSync as a, stat as v } from "node:fs";
5
- import { createRequire as P } from "node:module";
6
- import { dirname as k, join as h } from "node:path";
1
+ var m = Object.defineProperty;
2
+ var f = (i, e, t) => e in i ? m(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var p = (i, e, t) => f(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { readFileSync as v, existsSync as n, mkdirSync as g, writeFileSync as r, stat as k } from "node:fs";
5
+ import { createRequire as c } from "node:module";
6
+ import { dirname as P, join as h } from "node:path";
7
7
  import { fileURLToPath as D } from "node:url";
8
- import { registerTheme as y, getThemeInterface as w, getCss as F } from "@devup-ui/wasm";
9
- const T = D(import.meta.url), x = k(T);
8
+ import { registerTheme as w, getThemeInterface as y, getCss as F } from "@devup-ui/wasm";
9
+ const T = D(import.meta.url), x = P(T);
10
10
  class _ {
11
11
  constructor({
12
12
  package: e = "@devup-ui/react",
@@ -14,8 +14,8 @@ class _ {
14
14
  devupPath: o = "devup.json",
15
15
  interfacePath: s = ".df"
16
16
  }) {
17
- n(this, "options");
18
- n(this, "watch", !1);
17
+ p(this, "options");
18
+ p(this, "watch", !1);
19
19
  this.options = {
20
20
  package: e,
21
21
  cssFile: t,
@@ -25,26 +25,26 @@ class _ {
25
25
  }
26
26
  writeDataFiles() {
27
27
  var t;
28
- y(
29
- (t = JSON.parse(f(this.options.devupPath, "utf-8"))) == null ? void 0 : t.theme
28
+ w(
29
+ (t = JSON.parse(v(this.options.devupPath, "utf-8"))) == null ? void 0 : t.theme
30
30
  );
31
- const e = w(
31
+ const e = y(
32
32
  this.options.package,
33
33
  "DevupThemeColors",
34
34
  "DevupThemeTypography"
35
35
  );
36
- e && (p(this.options.interfacePath) || g(this.options.interfacePath), a(
36
+ e && (n(this.options.interfacePath) || g(this.options.interfacePath), r(
37
37
  h(this.options.interfacePath, "theme.d.ts"),
38
38
  e,
39
39
  {
40
40
  encoding: "utf-8"
41
41
  }
42
- )), a(this.options.cssFile, F(), {
42
+ )), r(this.options.cssFile, F(), {
43
43
  encoding: "utf-8"
44
44
  });
45
45
  }
46
46
  apply(e) {
47
- const t = p(this.options.devupPath);
47
+ const t = n(this.options.devupPath);
48
48
  if (t) {
49
49
  try {
50
50
  this.writeDataFiles();
@@ -56,21 +56,30 @@ class _ {
56
56
  });
57
57
  }
58
58
  let o = null;
59
- e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin", (s, u) => {
60
- this.watch = !0, t && v(this.options.devupPath, (r, l) => {
61
- if (r) {
62
- console.error(`Error checking ${this.options.devupPath}:`, r);
59
+ e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin", (s, l) => {
60
+ this.watch = !0, t && k(this.options.devupPath, (a, d) => {
61
+ if (a) {
62
+ console.error(`Error checking ${this.options.devupPath}:`, a);
63
63
  return;
64
64
  }
65
- const c = l.mtimeMs;
66
- o && o !== c && this.writeDataFiles(), o = c;
67
- }), u();
68
- }), p(this.options.cssFile) || a(this.options.cssFile, "", { encoding: "utf-8" }), e.options.module.rules.push({
65
+ const u = d.mtimeMs;
66
+ o && o !== u && this.writeDataFiles(), o = u;
67
+ }), l();
68
+ }), n(this.options.cssFile) || r(this.options.cssFile, "", { encoding: "utf-8" }), e.options.module.rules.push({
69
+ test: this.options.cssFile,
70
+ use: [
71
+ {
72
+ loader: c(import.meta.url).resolve(
73
+ "@devup-ui/webpack-plugin/css-loader"
74
+ )
75
+ }
76
+ ]
77
+ }), e.options.module.rules.push({
69
78
  test: /\.(tsx|ts|js|mjs|jsx)$/,
70
79
  exclude: /node_modules/,
71
80
  use: [
72
81
  {
73
- loader: P(import.meta.url).resolve(
82
+ loader: c(import.meta.url).resolve(
74
83
  "@devup-ui/webpack-plugin/loader"
75
84
  ),
76
85
  options: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devup-ui/webpack-plugin",
3
3
  "type": "module",
4
- "version": "0.1.10",
4
+ "version": "0.1.12",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -17,13 +17,17 @@
17
17
  "./loader": {
18
18
  "import": "./dist/loader.js",
19
19
  "require": "./dist/loader.cjs"
20
+ },
21
+ "./css-loader": {
22
+ "import": "./dist/css-loader.js",
23
+ "require": "./dist/css-loader.cjs"
20
24
  }
21
25
  },
22
26
  "files": [
23
27
  "dist"
24
28
  ],
25
29
  "dependencies": {
26
- "@devup-ui/wasm": "0.1.8"
30
+ "@devup-ui/wasm": "0.1.10"
27
31
  },
28
32
  "devDependencies": {
29
33
  "vite": "^6.0.7",