gant-core 2.0.6 → 2.0.7

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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"module";import{o as t,p as s,d as r,e as a,m as i,f as o,g as n,h as l}from"../../utils/index.mjs";import{g as m}from"./cssRules.mjs";import{resolve as p,posix as c}from"path";import{rspack as u}from"@rspack/core";import{b as g}from"./browsers.mjs";import{g as d}from"./framework/index.mjs";const f=e(import.meta.url),h=["name","routes","mpas","packages","microServiceMap","base","customHistoryApiFallback","outputPathDir","define","setting","framework","library","compression","terserOptions","htmlTemplatePath","locales","mfa","publicPathDir","provide","copy"],b=(e,b)=>{const x=t(b,h);let{base:y="/",routes:P,htmlTemplatePath:w,outputPathDir:j="dist",define:v,provide:k}=s(b,h);y=/^\/.*\/$/.test(y)?y:"/";const S=d(b,b.mode);let N=b.entry||{};const _=[];if(r(N)&&(N.index=p(e,"src/main")),"string"==typeof N.index){const e=a("string"==typeof w?w:w?.index);_.push(new u.HtmlRspackPlugin({template:e,filename:"index.html",chunks:["index"],publicPath:y,base:y,templateParameters:{base:y}})),b.entry=N}r(N)||Object.entries(N).forEach(([e,t])=>{if("index"!==e){const t=a("string"==typeof w?w:w?.[e]);_.push(new u.HtmlRspackPlugin({template:t,filename:`${e}.html`,chunks:[e],publicPath:y,base:y,templateParameters:{base:y}}))}});const O=m(b.mode);return i({entry:N,stats:"minimal",devServer:{static:{directory:p(e,"src/.gant/public"),publicPath:y},compress:!0,historyApiFallback:l(b,"customHistoryApiFallback")?b?.customHistoryApiFallback:{index:c.join(y,"index.html"),rewrites:[{from:/^\/public\/(.*)$/,to:e=>c.join(y,e.match[1])}]}},module:{rules:[...S.loaders,{test:/\.(ts|tsx)$/,exclude:/node_modules/,use:{loader:f.resolve("swc-loader"),options:{jsc:{target:"es2020",parser:{syntax:"typescript",tsx:!0,dynamicImport:!0},transform:S.swcTransform}}}},...O,{test:/\.ejs$/,use:{loader:f.resolve("ejs-loader"),options:{esModule:!1}}},{test:/\.(png|jpg|gif|woff|woff2|eot|ttf|svg)$/i,use:[{loader:f.resolve("url-loader"),options:{limit:8192,name:"[name][hash].[ext]",outputPath:"assets/"}}]}]},resolve:{extensions:[".tsx",".ts",".js",".jsx",".json",...S.extensions],alias:{"@gant/setting":p(e,n(),".gant/setting.ts"),"@gant/microServiceMap":p(e,n(),".gant/microServiceMap.ts")}},output:{path:p(e,j),publicPath:y,charset:!0,clean:!0},plugins:[...S.plugins,..._,new u.ProvidePlugin({...k}),new u.ProgressPlugin,new u.DefinePlugin({GANT_START_TIME:JSON.stringify(global.__gant_start_time),BASE:JSON.stringify(y),"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV),...o(v,e=>JSON.stringify(e))}),new u.BannerPlugin({banner:`/*! @browserslist ${g.join(", ")} */`,raw:!0})]},x)};export{b as g};
2
+ import{createRequire as e}from"module";import{o as t,p as s,d as r,e as a,m as i,f as o,g as n,h as l}from"../../utils/index.mjs";import{g as m}from"./cssRules.mjs";import{resolve as p,posix as c}from"path";import{rspack as u}from"@rspack/core";import{b as g}from"./browsers.mjs";import{g as f}from"./framework/index.mjs";const d=e(import.meta.url),h=["name","routes","mpas","packages","microServiceMap","base","customHistoryApiFallback","outputPathDir","define","setting","framework","library","compression","terserOptions","htmlTemplatePath","locales","mfa","publicPathDir","provide","copy"],b=(e,b)=>{const y=t(b,h);let{base:x="/",routes:P,htmlTemplatePath:w,outputPathDir:j="dist",define:v,provide:k}=s(b,h);const S="string"==typeof x&&(/^https?:\/\/.+\/$/.test(x)||/^\/.*\/$/.test(x)||/^\.\.?\//.test(x)||"/"===x||"./"===x);x=S?x:"/";const N=f(b,b.mode);let _=b.entry||{};const O=[];if(r(_)&&(_.index=p(e,"src/main")),"string"==typeof _.index){const e=a("string"==typeof w?w:w?.index);O.push(new u.HtmlRspackPlugin({template:e,filename:"index.html",chunks:["index"],publicPath:x,base:x,templateParameters:{base:x}})),b.entry=_}r(_)||Object.entries(_).forEach(([e,t])=>{if("index"!==e){const t=a("string"==typeof w?w:w?.[e]);O.push(new u.HtmlRspackPlugin({template:t,filename:`${e}.html`,chunks:[e],publicPath:x,base:x,templateParameters:{base:x}}))}});const $=m(b.mode);return i({entry:_,stats:"minimal",devServer:{static:{directory:p(e,"src/.gant/public"),publicPath:x},compress:!0,historyApiFallback:l(b,"customHistoryApiFallback")?b?.customHistoryApiFallback:{index:c.join(x,"index.html"),rewrites:[{from:/^\/public\/(.*)$/,to:e=>c.join(x,e.match[1])}]}},module:{rules:[...N.loaders,{test:/\.(ts|tsx)$/,exclude:/node_modules/,use:{loader:d.resolve("swc-loader"),options:{jsc:{target:"es2020",parser:{syntax:"typescript",tsx:!0,dynamicImport:!0},transform:N.swcTransform}}}},...$,{test:/\.ejs$/,use:{loader:d.resolve("ejs-loader"),options:{esModule:!1}}},{test:/\.(png|jpg|gif|woff|woff2|eot|ttf|svg)$/i,use:[{loader:d.resolve("url-loader"),options:{limit:8192,name:"[name][hash].[ext]",outputPath:"assets/"}}]}]},resolve:{extensions:[".tsx",".ts",".js",".jsx",".json",...N.extensions],alias:{"@gant/setting":p(e,n(),".gant/setting.ts"),"@gant/microServiceMap":p(e,n(),".gant/microServiceMap.ts")}},output:{path:p(e,j),publicPath:x,charset:!0,clean:!0},plugins:[...N.plugins,...O,new u.ProvidePlugin({...k}),new u.ProgressPlugin,new u.DefinePlugin({GANT_START_TIME:JSON.stringify(global.__gant_start_time),BASE:JSON.stringify(x),"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV),...o(v,e=>JSON.stringify(e))}),new u.BannerPlugin({banner:`/*! @browserslist ${g.join(", ")} */`,raw:!0})]},y)};export{b as g};
3
3
  //# sourceMappingURL=default.config.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gant-core",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "main": "lib/core/index.js",
6
6
  "types": "lib/types/index.d.ts",