@moneko/core 3.33.3-beta.0 → 3.34.0-beta.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/lib/config.d.mts +1 -1
- package/lib/config.mjs +1 -1
- package/lib/dev.d.mts +57 -0
- package/lib/dev.mjs +1 -0
- package/lib/file-system.d.mts +2 -0
- package/lib/file-system.mjs +1 -0
- package/lib/loader/prefix-monaco-editor.cjs +1 -0
- package/lib/loader/prefix-monaco-editor.d.cts +3 -0
- package/lib/module.config.mjs +2 -2
- package/lib/plugins.config.d.mts +1 -1
- package/lib/plugins.config.mjs +1 -1
- package/package.json +1 -2
package/lib/config.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import splitChunk from './options/split-chunk.mjs';
|
|
|
9
9
|
import { isFunction, node_modules, resolveProgram } from './utils/index.mjs';
|
|
10
10
|
import type { ConfigType } from './index.mjs';
|
|
11
11
|
import { APPTYPE, FRAMEWORK, frameworkVersion, isDev, isLibrary, isMobile, isReact, jsxImportSource, mainDirectory, NODE_ENV, PACKAGENAME } from './process-env.mjs';
|
|
12
|
-
declare const includeModule: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string
|
|
12
|
+
declare const includeModule: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string];
|
|
13
13
|
export declare function getConfig(path: string): Promise<ConfigType>;
|
|
14
14
|
type EnvType = {
|
|
15
15
|
NODE_ENV: string;
|
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as e}from"node:path";import{fileExists as o}from"@moneko/utils";import{merge as t}from"webpack-merge";import
|
|
1
|
+
import{relative as e}from"node:path";import{fileExists as o}from"@moneko/utils";import{merge as t}from"webpack-merge";import r from"./commom/paths.mjs";import s from"./commom/require.mjs";import n from"./commom/setup-env.mjs";import i from"./options/jsx-dom-expressions.mjs";import a from"./options/split-chunk.mjs";import{isFunction as l,node_modules as m,resolveProgram as p}from"./utils/index.mjs";import{APPTYPE as c,FRAMEWORK as u,frameworkVersion as d,isDev as f,isLibrary as g,isMobile as h,isReact as x,jsxImportSource as j,mainDirectory as v,NODE_ENV as P,PACKAGENAME as C}from"./process-env.mjs";let b=["@app","@moneko","neko-ui",".cache/http/data","@element-plus","ant-design-vue","element-plus","element-ui","ng-zorro-antd","@mui","@du","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design","monaco-editor"];export function getConfig(e){return delete s.cache[e],new Promise(t=>{if(o(e)){let o=s(e).default;return t(l(o)?o(process):o)}return t({})})}let k=await Promise.all([n(P,c,u,[]),getConfig(r.configPath),getConfig(r.customConfigPath)]),w=k[0],O=k[1],y=k[2],I={strict:!1,devtool:f?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,mode:"csr",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:w,basename:"/",publicPath:"/",rem:{designSize:h?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":p(v)},x&&d<18?{"react/package.json":m("react/package.json"),"react/jsx-runtime":m("react/jsx-runtime.js"),"react/jsx-dev-runtime":m("react/jsx-dev-runtime.js")}:{}),moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3},htmlPluginOption:{title:C.toLocaleUpperCase(),favicon:e(r.programPath,`${r.corePath}/options/favicon.ico`)},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:a,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:b,js:b,media:b,font:b,wasm:[]},mdx:{jsx:!1,development:f,jsxImportSource:j,providerImportSource:`@moneko/${u}/mdx`},jsxDomExpressions:i,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69"},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:"solid"!==u,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{}};g&&(I.alias=Object.assign(I.alias,{"@pkg":r.componentsPath,[C]:r.componentsPath}));let M=I;(!1===(M=t(M,O,y)).devtool||!1===M.sourceMap)&&(M.sourceMap=!1,M.devtool=!1),M.fixBrowserRouter&&M.htmlPluginOption&&(M.htmlPluginOption.tags||(M.htmlPluginOption.tags=[]),M.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}));export const CONFIG=M;export const PUBLICPATH=CONFIG.publicPath;
|
package/lib/dev.d.mts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { exec, spawn } from 'node:child_process';
|
|
2
|
+
import { type createReadStream, type existsSync, watchFile } from 'node:fs';
|
|
3
|
+
import { extname, relative, sep } from 'node:path';
|
|
4
|
+
import { ink, loadFile, print, println, progressBar } from '@moneko/utils';
|
|
5
|
+
import fastify, { type FastifyInstance, type FastifyReply, type FastifyRequest } from 'fastify';
|
|
6
|
+
import webpack, { type Compiler, type OutputFileSystem, type Watching, type WebpackPluginInstance } from 'webpack';
|
|
7
|
+
import webpackHotMiddleware, { type ClientOptions } from 'webpack-hot-middleware';
|
|
8
|
+
import { merge } from 'webpack-merge';
|
|
9
|
+
import { diffObject } from './commom/diff-object.mjs';
|
|
10
|
+
import mime from './commom/mime.mjs';
|
|
11
|
+
import paths, { config_files } from './commom/paths.mjs';
|
|
12
|
+
import sigintExit from './commom/sigint-exit.mjs';
|
|
13
|
+
import { devLog, PORT } from './dev/config.mjs';
|
|
14
|
+
import setupMock from './dev/mock.mjs';
|
|
15
|
+
import { type ProxyConfig, setupProxy } from './dev/proxy.mjs';
|
|
16
|
+
import reslove from './options/reslove.mjs';
|
|
17
|
+
import ESLintPlugin from './plugin/eslint.mjs';
|
|
18
|
+
import StylelintPlugin from './plugin/stylelint.mjs';
|
|
19
|
+
import { empty } from './utils/index.mjs';
|
|
20
|
+
import { commonConfig } from './common.mjs';
|
|
21
|
+
import { CONFIG, getConfig, PUBLICPATH } from './config.mjs';
|
|
22
|
+
import { outputFileSystem } from './file-system.mjs';
|
|
23
|
+
import type { ConfigType } from './index.mjs';
|
|
24
|
+
import moduleConfig from './module.config.mjs';
|
|
25
|
+
import { isLibrary, isReact, refresh } from './process-env.mjs';
|
|
26
|
+
type WebpackPlugin = new(opt?: object) => WebpackPluginInstance;
|
|
27
|
+
declare const hmrPath: string;
|
|
28
|
+
declare const clientParams: ClientOptions;
|
|
29
|
+
declare const hotParams: string;
|
|
30
|
+
declare const path: string | undefined;
|
|
31
|
+
declare const clientOption: webpack.Configuration;
|
|
32
|
+
declare function getLintFiles(exts: string[]);
|
|
33
|
+
declare const compilers: Compiler;
|
|
34
|
+
declare const watching: Watching;
|
|
35
|
+
interface FastifyOptions {
|
|
36
|
+
http2?: boolean;
|
|
37
|
+
https?: {
|
|
38
|
+
key: string;
|
|
39
|
+
cert: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare const fastifyOptions: FastifyOptions;
|
|
43
|
+
declare const hotMiddleware: ReturnType<typeof webpackHotMiddleware>;
|
|
44
|
+
declare const app: FastifyInstance;
|
|
45
|
+
declare const normalHeaders: Record<string, string>;
|
|
46
|
+
type FileSystem = OutputFileSystem & {
|
|
47
|
+
existsSync: typeof existsSync;
|
|
48
|
+
createReadStream: typeof createReadStream;
|
|
49
|
+
};
|
|
50
|
+
declare function replyStream(req: FastifyRequest, reply: FastifyReply, filePath: string);
|
|
51
|
+
declare function exit();
|
|
52
|
+
declare const _prev: ConfigType[];
|
|
53
|
+
declare let prev: ConfigType;
|
|
54
|
+
declare function watchConfig(filepath: string);
|
|
55
|
+
declare function restart();
|
|
56
|
+
declare const isWindow: boolean;
|
|
57
|
+
declare function killPort(port: number);
|
package/lib/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{exec as e,spawn as t}from"node:child_process";import{watchFile as o}from"node:fs";import{extname as r,relative as s,sep as n}from"node:path";import{ink as i,loadFile as l,print as a,println as m,progressBar as p}from"@moneko/utils";import c from"fastify";import d from"webpack";import u from"webpack-hot-middleware";import{merge as h}from"webpack-merge";import{diffObject as f}from"./commom/diff-object.mjs";import g from"./commom/mime.mjs";import y,{config_files as w}from"./commom/paths.mjs";import $ from"./commom/sigint-exit.mjs";import{devLog as x,PORT as v}from"./dev/config.mjs";import C from"./dev/mock.mjs";import{setupProxy as j}from"./dev/proxy.mjs";import P from"./options/reslove.mjs";import S from"./plugin/eslint.mjs";import k from"./plugin/stylelint.mjs";import{empty as b}from"./utils/index.mjs";import{commonConfig as A}from"./common.mjs";import{CONFIG as O,getConfig as T,PUBLICPATH as H}from"./config.mjs";import{outputFileSystem as E}from"./file-system.mjs";import I from"./module.config.mjs";import{isLibrary as R,isReact as _,refresh as M}from"./process-env.mjs";let U=`${H.endsWith("/")?"":"/"}__hmr__`,z=new URLSearchParams({name:"client",path:U,dynamicPublicPath:!0,timeout:2e3,reload:!M,quiet:!0,noInfo:!0,overlay:!1,autoConnect:!0}).toString(),F=A.output.path,q=h(A,{watchOptions:{ignored:/node_modules\/(?!(@app|@moneko)).+/},entry:{main:[`${P.hotMiddlewareClient}?${z}`]},output:{path:F},module:I(!1),plugins:[new d.HotModuleReplacementPlugin,new d.WatchIgnorePlugin({paths:[/node_modules\/(?!(@app|@moneko)).+/,/\.d\.ts$/]})]});if(q.plugins||(q.plugins=[]),_){let e=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;q.plugins.push(new e({overlay:!1}))}function B(e){let t=e.join(","),o=[s(y.programPath,`${O.alias["@"]}/**/*.{${t}}`).replace(/\\/g,"/")];return R&&o.push(s(y.programPath,`${O.alias["@pkg"]}/**/*.{${t}}`).replace(/\\/g,"/")),o}if(O.eslint&&q.plugins.push(new S({fix:!0,cache:!0,cacheLocation:`${y.lintCachePath}/.eslintcache`,cacheStrategy:"metadata",lintDirtyModulesOnly:!0,...O.eslint,files:B(["js","jsx","ts","tsx","json","html","vue"])})),O.stylelint&&q.plugins.push(new k({fix:!0,cache:!0,cacheLocation:`${y.lintCachePath}/.stylelintcache`,...O.stylelint,files:B(["css","scss","sass","less","ts","tsx","js","jsx"])})),O.bar){let e=O.bar,t=e.name||"Build";q.plugins.push(new d.ProgressPlugin({handler(o,r,...s){p(o||0,1,{msg:s.length?`[${r}] ${s.join(" ")}`:"",name:t,barColor:e.barColor,nameColor:e.nameColor,barBgColor:e.barBgColor,msgColor:e.msgColor}),1===o&&process.stdout.write("\r\x1b[2K")}}))}let L=d(q);L.outputFileSystem=E;let N=L.watch(L.options.watchOptions,x);L.hooks.done.tap("client-log",e=>{x(null,e)});let D={};if(O.devServer.https){let[e,t]=await Promise.all([l(O.devServer.https.key),l(O.devServer.https.cert)]);e||(m(i(`法加载私钥。请检查路径和文件是否存在,并确保路径正确:${O.devServer.https.key}`,"red")),process.exit(1)),t||(m(i(`无法加载证书。请检查路径和文件是否存在,并确保路径正确:${O.devServer.https.cert}`,"red")),process.exit(1)),D.http2=!0,D.https={key:e,cert:t}}let G=u(L,{log:!1,path:U,heartbeat:2e3}),W=c({logger:!1,...D});C(W,{directory:y.mockPath}),j(W,O.proxy);let K={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization","Access-Control-Allow-Methods":"GET, POST, OPTIONS, DELETE, PATCH, PUT","Access-Control-Allow-Origin":"*","Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0",...O.devServer.headers||{}};function X(e,t,o){t.headers(K),e.headers.origin&&t.header("Access-Control-Allow-Origin",e.headers.origin);let s=L.outputFileSystem,n=e.headers["accept-encoding"],i=n?.includes("gzip"),l=s.existsSync?.(`${o}.gz`);i&&l&&t.header("content-encoding","gzip");let a=s.createReadStream?.(i&&l?`${o}.gz`:o,{autoClose:!0});a?.on("error",e=>{if(a.destroy(),!t.sent)return t.code(404).type("text/html").send(`File not found: ${e.message}`)});let m=g[r(o)];return m&&t.header("content-type",m),t.send(a)}function J(){process.exit(0)}W.get(`/${U}`.replace("//","/"),async(e,t)=>{if("text/event-stream"===e.headers.accept){e.raw.url=U,G(e.raw,t.raw,()=>{t.raw.writableEnded&&(t.sent=!0)});return}}),W.addHook("onRequest",(e,t,o)=>{let r=decodeURIComponent(`${q.output.path}${n}${"/"===e.url?"index.html":e.url}`);return L.outputFileSystem?.existsSync?.(r)?X(e,t,r):o()}),W.setNotFoundHandler((e,t)=>X(e,t,`${q.output.path}${n}index.html`)),W.addHook("onClose",()=>{N.close(b),W.server.close(b)}),W.listen({port:v});let Q=await Promise.all(w.map(T)),V=h(Q[0]||{},Q[1]||{});w.forEach(function(t){o(t,async function(){let[o,r]=await Promise.all(w.map(T)),s=h(o||{},r||{}),n=f(V,s);1===Object.keys(n).length&&"proxy"in n?(a(i(`代理更新中...`,"yellow"),!0),await j(W,s.proxy),a(i(`代理更新完成...`,"green"),!0),O.proxy=s.proxy,V.proxy=s.proxy,V=s):(V=s,m(i(`检测到工程配置${i(`[${t}]`,"blue")}变更, 程序即将重启...`,"yellow"),!0),e(Y?`netstat -ano | findstr :${v}`:`lsof -i :${v} -t`,(e,t)=>{if(e){m(i(`查找端口 ${v} 时发生错误: ${e.message}`,"red")),m(i("请尝试手动重启程序","yellow"));return}let o=t.trim().replace(/\r\n/g,"\n").split("\n").filter(Boolean),r=Y?o[0]?.split(/\s+/).pop()?.trim():o[0]?.trim();if(!r){m(i(`未找到占用端口 ${v} 的进程, 请尝试手动重启程序`,"yellow"));return}try{process.kill(Number(r),"SIGHUP")}catch(e){m(i(`终止进程 ${r} 时发生错误: ${e.message}`,"red"))}}))})});let Y="win32"===process.platform;process.on("SIGHUP",function(){W.close(b),function(){let e=t(process.argv[0],process.argv.slice(1),{detached:!1,stdio:"inherit"});e.unref(),e.on("close",J)}()}),process.on("exit",function(){W.close(b)}),$(J);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createFsFromVolume as t,Volume as e}from"memfs";export const outputFileSystem=t(new e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";async function e(e){return this.async()(null,(this.cacheable&&this.cacheable(),this.resourcePath.includes("monaco-editor")&&e.includes("//# sourceMappingURL=marked.umd.js.map"))?e.replace("//# sourceMappingURL=marked.umd.js.map",""):e)}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});
|
package/lib/module.config.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e;import{join as
|
|
2
|
-
`)}:void 0},importLoaders:2}},O={loader:d.lessLoader,options:{sourceMap:!!P.sourceMap,lessOptions:{modifyVars:c,javascriptEnabled:!0}}},b=new Map;function C(e){if(b.has(e))return b.get(e);try{let
|
|
1
|
+
let e;import{join as o,sep as s}from"node:path";import{saveFileSync as t}from"@moneko/utils";import r,{CUSTOMCONFIG as a}from"./commom/paths.mjs";import n from"./commom/reactive-object.mjs";import m from"./commom/require.mjs";import i from"./commom/rule.mjs";import l from"./options/css-extract.mjs";import c from"./options/modify-vars.mjs";import d from"./options/reslove.mjs";import p from"./options/swcrc.mjs";import{getLightningCssTargets as u}from"./polyfills/targets.mjs";import{node_modules as f,resolveProgram as j,toCamelCase as h}from"./utils/index.mjs";import y from"./utils/svg-to-data-uri.mjs";import{comment as g,getCommentPath as v}from"./vm/docs.mjs";import x from"./vm/generate-doc.mjs";import{outputConfig as w}from"./common.mjs";import{CONFIG as P}from"./config.mjs";import{FRAMEWORK as L,isDev as M,isLibrary as _}from"./process-env.mjs";let k={loader:o(r.corePath,"/loader/lightning-css/loader.cjs"),options:{sourceMap:!!P.sourceMap,targets:u(),rem:!!P.rem,esModule:!0,modules:{auto(e){if(e){if(e.endsWith(".css")&&!e.endsWith("module.css"))return!1;for(let o=0,s=I.length;o<s;o++)if(e.includes(I[o]))return i.css_module.test(e)}return i.node_modules_css_module.test(e)},localIdentName:"[name][hash]_[local]",namedExport:!0,exportLocalsConvention:"dashesOnly",exportOnlyLocals:!1,getJSON:P.cssModuleDefinition?function(e){q.setData(`${e.resourcePath}.d.ts`,`${e.exports.map(({name:e,value:o})=>`export const ${h(e)}: '${o}';`).join("\n")}
|
|
2
|
+
`)}:void 0},importLoaders:2}},O={loader:d.lessLoader,options:{sourceMap:!!P.sourceMap,lessOptions:{modifyVars:c,javascriptEnabled:!0}}},b=new Map;function C(e){if(b.has(e))return b.get(e);try{let o;let t=m.resolve(e).split(s),r=t.lastIndexOf("node_modules");return o=-1!==r?t.slice(0,r).join(s):t.join(s),b.set(e,[o]),[o]}catch{return b.set(e,[f(e),f(`.pnpm/${e}`)]),b.get(e)}}let I=[...P.cssModules,`@moneko/${L}`,"neko-ui"].map(C).flat(),$=["components","example","mock","site","src","server"].map(j);function J(e){return new Promise(o=>{o([...$,r.corePath,...P.rulesInclude?.[e]?.map(C).flat()||[]])})}a&&$.push(j(a)),P.overrideResolve&&P.overrideResolve.override&&$.push(P.overrideResolve.override);let W=await Promise.all([J("css"),J("js"),J("media"),J("wasm"),J("font")]),R=W[0],B=W[1],N=W[2],S=W[3],z=W[4];d.sassLoader&&(e={loader:d.sassLoader,options:{implementation:await import("sass"),sassOptions:{}}});let D=_&&M&&{test:i.tsdoc,include:P.alias["@pkg"],exclude:[/node_modules\/(?!(@app|@moneko)).+/,i.__tests__],enforce:"pre",loader:o(r.corePath,"/loader/ts-doc.cjs"),options:{comment:g,generateDoc:x,getCommentPath:v}},E=w.library?.type==="umd"&&!1===P.htmlPluginOption,Q=[{resourceQuery:/raw/i,type:"asset/source"},{resourceQuery:/url/i,type:"asset/resource",generator:{filename(e){let o=e.filename;return o&&o.toLocaleLowerCase().endsWith("wasm?url")?"wasm/[name][ext]":"assets/[name][ext]"}}},{test:i.wasm,type:"webassembly/async",include:S},{test:i.txt,type:"asset/source"},{test:i.image,type:"asset",dependency:{not:["url"]},parser:{dataUrlCondition:E?()=>!0:{maxSize:4096}},generator:{filename:e=>e.filename?.toLocaleLowerCase().endsWith(".svg")?"assets/svg/[name][ext]":"assets/images/[name][ext]",dataUrl:(e,o)=>o.filename.toLocaleLowerCase().endsWith(".svg")?y(e.toString()):e},include:N},{test:i.video,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[name][ext]"},include:N},{test:i.font,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[name][ext]"},include:z}],U=P.prefixJsLoader.filter(Boolean)||[];switch(U.push({loader:o(r.corePath,"/loader/prefix-monaco-editor.cjs"),include:["monaco-editor"]}),L){case"react":P.reactCompiler&&U.unshift({loader:o(r.corePath,"/loader/react-compiler.cjs"),options:P.reactCompiler});break;case"solid":P.refresh=!1}P.cssInJs&&"object"==typeof P.cssInJs.minify&&U.unshift({loader:o(r.corePath,"/loader/css-in-js-minify.cjs"),options:Object.assign({moduleName:"@moneko/css",allowFuncs:["css","injectGlobal"]},P.cssInJs.minify)});let q=new n({});q.on("change",(e,o)=>{t(e,o)});export default(s=>{let t={loader:d.swcLoader,options:p(s)};return{parser:{javascript:{commonjsMagicComments:!0,dynamicImportMode:"lazy",dynamicImportPrefetch:!1,dynamicImportPreload:!1,importMeta:!0,importMetaContext:!0}},noParse:P.noParse,rules:[!1!==P.htmlPluginOption&&D,{oneOf:[...Q,{test:i.js,use:[...U,t],include:B},{test:i.css,use:[l,k],include:R},e&&{test:i.scss,use:[l,k,e],include:R},{test:i.less,use:[l,k,O],include:R},{test:i.markdown,use:[...U,{loader:o(r.corePath,"/loader/mdx.cjs"),options:P.mdx}],exclude:[/node_modules\/(?!(@app|@moneko)).+/]}].filter(Boolean)},...P.moduleRules].filter(Boolean)}});
|
package/lib/plugins.config.d.mts
CHANGED
|
@@ -5,6 +5,6 @@ import { HtmlMeta, HtmlPlugin } from './plugin/html-plugin.mjs';
|
|
|
5
5
|
import moduleFederation from './plugin/module-federation.mjs';
|
|
6
6
|
import { VirtualModuleWebpackPlugin } from './plugin/virtual-module.mjs';
|
|
7
7
|
import { CONFIG } from './config.mjs';
|
|
8
|
-
import { packageJson } from './process-env.mjs';
|
|
8
|
+
import { isDev, packageJson } from './process-env.mjs';
|
|
9
9
|
declare const plugins: WebpackPluginInstance[];
|
|
10
10
|
export default plugins;
|
package/lib/plugins.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"compression-webpack-plugin";import t from"webpack";import{CopyPlugin as i}from"./plugin/copy.mjs";import{HtmlPlugin as o}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as l}from"./plugin/virtual-module.mjs";import{CONFIG as n}from"./config.mjs";import{packageJson as
|
|
1
|
+
import e from"compression-webpack-plugin";import t from"webpack";import{CopyPlugin as i}from"./plugin/copy.mjs";import{HtmlPlugin as o}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as l}from"./plugin/virtual-module.mjs";import{CONFIG as n}from"./config.mjs";import{isDev as p,packageJson as a}from"./process-env.mjs";let s=[...r,new l(n.virtualModule),new i(n.copy),new t.DefinePlugin({"process.env":JSON.stringify(n.env)}),new t.IgnorePlugin({resourceRegExp:/\/(__(tests|mocks)__|test|spec|e2e)\//}),...n.plugins,p&&new e({filename:"[path][base].gz",algorithm:"gzip",test:/\.(js|css|html|svg)$/})].filter(Boolean);if(n.htmlPluginOption){let e={charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no","mobile-web-app-capable":"yes",renderer:"webkit",description:a.description,keywords:Array.isArray(a.keywords)?a.keywords.toString():"","http-equiv":"refresh",viewport:"width=device-width, initial-scale=1"};n.seo&&(e.relCanonical={rel:"canonical",href:`https://${n.seo.domain}${n.basename}`}),n.htmlPluginOption.meta&&Object.assign(e,n.htmlPluginOption.meta),s.push(new o({...n.htmlPluginOption,meta:e}))}if(n.fixBrowserRouter){let e=n.basename.split("/").filter(Boolean).length,t=`${Array(e).fill("..").join("/")+(e?"/":"")}404.html`,i=n.fixBrowserRouter.pathSegmentsToKeep??e;s.push(new o({filename:n.fixBrowserRouter.path??t,inject:!1,templateContent:()=>`<html lang="en"><head><title>Redirect</title><script>const pathKeep = ${i};const l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>`}))}n.sourceMap&&s.push(new t.SourceMapDevToolPlugin(n.sourceMap));export default s;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0-beta.0",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"lightningcss": "1.29.3",
|
|
36
36
|
"marked-completed": "1.2.14",
|
|
37
37
|
"memfs": "4.17.0",
|
|
38
|
-
"unionfs": "4.5.4",
|
|
39
38
|
"mini-css-extract-plugin": "2.9.2",
|
|
40
39
|
"style-loader": "4.0.0",
|
|
41
40
|
"swc-loader": "0.2.6",
|