@moneko/core 3.9.17-beta.8 → 3.9.17-beta.9
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/build.mjs +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/plugin/virtual-module.mjs +1 -1
- package/lib/plugins.config.mjs +1 -1
- package/package.json +3 -1
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as e}from"@moneko/mdx";import o from"mini-css-extract-plugin";import m from"terser-webpack-plugin";import
|
|
1
|
+
import{removeDirAll as e}from"@moneko/mdx";import o from"mini-css-extract-plugin";import m from"terser-webpack-plugin";import i from"webpack";import{BundleAnalyzerPlugin as n}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import t from"webpack-node-externals";import s from"webpackbar";import{commonConfig as a}from"./common.mjs";import{CONFIG as l}from"./config.mjs";import{getMinifyOption as p}from"./minify.mjs";import u from"./module.config.mjs";import c,{CUSTOMCONFIG as f}from"./paths.mjs";import d from"./plugin/done.mjs";import h from"./plugin/lightningcss-plugin.mjs";import w from"./plugin/virtual-module.mjs";import{SSR as g,isLibrary as k}from"./process-env.mjs";import b from"./seo.mjs";import{compilerListener as j,log as y,resolveProgramPath as v}from"./utils.mjs";let{optimize:{MinChunkSizePlugin:z,ModuleConcatenationPlugin:x}}=i,C=[];l.minifier&&(C.push(new m(p(l.minifier?.type||"swc",l.minifier?.options))),C.push(new h));let E={splitChunks:l.splitChunk,runtimeChunk:l.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:C},I=[new x,new o({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),l.splitChunk&&new z({minChunkSize:1e4}),l.bundleAnalyzer&&new n(l.bundleAnalyzer)].filter(Boolean),M=a.output.path;g&&(M=v(`${k?"docs":"dist"}/client`));let A=[r(a,{optimization:E,output:{path:M},module:u(!1),plugins:[new w(l.virtualModule),...I,(l.done||l.seo)&&new d({done(e){l.done?.(e),l.seo&&b()}}),l.bar&&new s(l.bar)].filter(Boolean)})];if(g){let e=r(a,{entry:{main:v("site/ssr.tsx")},output:{path:v(`${k?"docs":"dist"}/server`),library:{type:"commonjs2",umdNamedDefine:!1},filename:"[name].cjs",chunkFilename:"[chunkhash].cjs",globalObject:"global"},cache:{type:"filesystem",name:[f,process.env.NODE_ENV,"server"].filter(Boolean).join("-")},externalsPresets:{node:!0},externals:[t({allowlist:["react","react-dom","solid-js"]})],resolve:{fallback:{path:"path",fs:"fs",crypto:"crypto",assert:"assert"}},optimization:E,module:u(!0),target:"node",plugins:[new w(l.virtualModule),...I,new s({name:"Server"})]});A.push(e)}let[B,D]=i(A).compilers,N=[j("client",B)];D&&N.push(j("server",D)),async function(){i(A).run((e,o)=>{if(e)throw e;o&&o.stats.forEach(e=>{e.compilation.warnings.forEach(e=>y(e.message)),e.compilation.errors.forEach(e=>y(e.message))})}),await Promise.all(N)}(),process.on("exit",function(){e(c.cachePath)});
|
package/lib/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as e}from"@moneko/mdx";import o from"cors";import
|
|
1
|
+
import{removeDirAll as e}from"@moneko/mdx";import o from"cors";import r from"express";import t from"nodemon";import s from"webpack";import i from"webpack-dev-middleware";import l from"webpack-hot-middleware";import{merge as a}from"webpack-merge";import n from"webpack-node-externals";import m from"webpackbar";import{commonConfig as c}from"./common.mjs";import{CONFIG as p}from"./config.mjs";import{PORT as d,devLog as u,headers as f}from"./dev-config.mjs";import{hasPkg as g}from"./has-pkg.mjs";import h from"./module.config.mjs";import w,{CUSTOMCONFIG as b}from"./paths.mjs";import k from"./plugin/virtual-module.mjs";import{SSR as j,isLibrary as x,isReact as v}from"./process-env.mjs";import{compilerListener as y,resolveProgramPath as $}from"./utils.mjs";let{HotModuleReplacementPlugin:_}=s,P=g("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,S=g("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,B=v&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,D=["js","jsx","ts","tsx","json","html","vue"],E=D.join(","),M=["css","scss","sass","less","ts","tsx","js","jsx"],O=M.join(","),I=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],N=new URLSearchParams({timeout:2e3,reload:!0,quiet:!0,noInfo:!0,overlay:!1,dynamicPublicPath:!0}).toString(),T=[a(c,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${d}/__hmr__&${N}`]},module:h(!1),plugins:[new k(p.virtualModule),new _,B&&new B,S&&new S({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${E}}`,x&&`${p.alias["@pkg"]}/**/*.{${E}}`].filter(Boolean),extensions:D,exclude:I,cache:!0,lintDirtyModulesOnly:!0}),P&&new P({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${O}}`,x&&`${p.alias["@pkg"]}/**/*.{${O}}`].filter(Boolean),extensions:M,exclude:I,cache:!0,lintDirtyModulesOnly:!0}),p.bar&&new m(p.bar)].filter(Boolean)})];if(j){let e=a(c,{entry:{main:$("site/ssr.tsx")},output:{path:$(`${x?"docs":"dist"}/server`),library:{type:"commonjs2"},filename:"[name].cjs",chunkFilename:"[name].cjs",globalObject:"global"},cache:{type:"filesystem",name:[b,process.env.NODE_ENV,"server"].filter(Boolean).join("-")},externals:[n({allowlist:["react","react-dom","solid-js"]})],module:h(!0),target:"node",plugins:[new k(p.virtualModule),new m({name:"Server"})].filter(Boolean)});T.push(e)}let[q,R]=s(T).compilers,U=r();U.use(o()),U.use(i(q,{writeToDisk:!0,index:"index.html",headers:()=>f,serverSideRender:j})),U.use(l(q,{log:!1,path:"/__hmr__",heartbeat:2e3,ignoreUnaccepted:!1,ignoreDeclined:!0,ignoreErrored:!0}));let A=[y("client",q)];R&&(A.push(y("server",R)),R.watch({aggregateTimeout:20,ignored:/node_modules(?![\\/]@app)/,poll:1e3,stdin:!0},u)),await Promise.all(A),q.hooks.done.tap("client",e=>{u(null,e)}),g("@moneko/mock")&&import("@moneko/mock").then(e=>{e.default(U,$("mock/"))}),U.listen(d,()=>{});let F=t({script:`${w.programPath}/docs/server/main.cjs`,ignore:["src","webpack","scripts",`${w.programPath}/docs/client`,"public","node_modules"],delay:100});F.on("restart",()=>{console.log("Server side app has been restarted")}),F.on("quit",()=>{console.log("Process ended"),process.exit()}),F.on("error",()=>{console.log("An error occured. Exiting"),process.exit(1)}),process.on("exit",function(){}),process.on("SIGINT",()=>{e(w.cachePath),process.exit()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils.mjs";import{comment as
|
|
1
|
+
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils.mjs";import{comment as r,docs as m}from"../vm/docs.mjs";import{examples as p}from"../vm/example.mjs";import{locales as s}from"../vm/locales.mjs";import i from"../vm/modules.mjs";import{route as a}from"../vm/routes.mjs";export default class{constructor(o={}){this.options=o,this.hasTapped=!1}apply(l){let n=this.options,f=new o(i);function c(o,t){let r=e(o);f.writeModule(r,t||"")}f.apply(l),a.on("change",c),s.on("change",c),t&&(p.on("change",c),m.on("change",c),r.on("change",c)),l.hooks.compilation.tap("VirtualModuleWebpackPlugin",()=>{if(!this.hasTapped){for(let o in this.hasTapped=!0,n)if(Object.prototype.hasOwnProperty.call(n,o)){let t=n[o];c(o,"string"==typeof t?t:`export default ${JSON.stringify(t)}`)}for(let o of p)c(...o);for(let o of m)c(...o);for(let o of r)c(...o)}})}}
|
package/lib/plugins.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"add-asset-html-webpack-plugin";import t from"html-webpack-plugin";import l from"webpack";import{CONFIG as o}from"./config.mjs";import i from"./html-plugin-option.mjs";import
|
|
1
|
+
import e from"add-asset-html-webpack-plugin";import t from"html-webpack-plugin";import l from"webpack";import{CONFIG as o}from"./config.mjs";import i from"./html-plugin-option.mjs";import n from"./module-federation.mjs";import p from"./plugin/add-entry-attribute.mjs";import{isMicro as r}from"./process-env.mjs";let{AutomaticPrefetchPlugin:a,DefinePlugin:s,SourceMapDevToolPlugin:m,IgnorePlugin:c,WatchIgnorePlugin:h}=l,f=o.basename.split("/").filter(Boolean).length,d=`${Array(f).fill("..").join("/")+(f?"/":"")}404.html`,{pathSegmentsToKeep:u=f,path:w=d}=o.fixBrowserRouter||{},g=o.assetHtml.map(e=>({publicPath:"",...e})),j=[new h({paths:[/\.d\.ts$/]}),...n,new a,o.htmlPluginOption&&new t(i),o.fixBrowserRouter&&new t({filename:w,inject:!1,templateContent:()=>`<html lang="en"><head><title>${i.title}</title><script>const pathKeep = ${u||f};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>`}),new e(g),r&&new p({test:/main\.bundle\.js$/}),new s({"process.env":JSON.stringify(o.env)}),new c({resourceRegExp:/\/__tests__\//}),o.sourceMap&&new m(o.sourceMap),...o.plugins].filter(e=>!!e);export default j;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.9.17-beta.
|
|
3
|
+
"version": "3.9.17-beta.9",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"less-loader": "11.1.3",
|
|
31
31
|
"lightningcss": "1.22.1",
|
|
32
32
|
"mini-css-extract-plugin": "2.7.6",
|
|
33
|
+
"nodemon": "3.0.2",
|
|
33
34
|
"style-loader": "3.3.3",
|
|
34
35
|
"swc-loader": "0.2.3",
|
|
35
36
|
"swc-plugin-another-transform-imports": "0.2.7",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"@swc/cli": "0.1.63",
|
|
49
50
|
"@types/cors": "2.8.17",
|
|
50
51
|
"@types/express": "4.17.21",
|
|
52
|
+
"@types/nodemon": "^1.19.6",
|
|
51
53
|
"eslint-config-neko": "2.3.0",
|
|
52
54
|
"eslint-webpack-plugin": "4.0.1",
|
|
53
55
|
"sass": "1.69.5",
|