@moneko/core 3.17.6 → 3.17.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.
- package/lib/common.mjs +1 -1
- package/lib/config.mjs +1 -1
- package/package.json +1 -1
package/lib/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as s}from"./paths.mjs";import r from"./plugin/override-resolve.mjs";import
|
|
1
|
+
import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as s}from"./paths.mjs";import r from"./plugin/override-resolve.mjs";import a from"./plugins.config.mjs";import{PACKAGENAME as n,PACKAGEVERSION as i,isDev as l,isLibrary as p}from"./process-env.mjs";import m from"./rule.mjs";import{isObject as c,node_modules as u,resolveProgram as d}from"./utils/index.mjs";import{join as f,resolve as h}from"path";import{exampleModuleName as y}from"./vm/example.mjs";export const outputConfig={path:d(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${l?"name":"chunkhash"}].js`,assetModuleFilename:e=>{let t=e.filename;return t?.endsWith("?url")&&m.worker_file.test(t.replace("?url",""))?"worker/[name][ext]":"assets/[name][hash][ext]"},library:{name:n,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${n}`,pathinfo:l,clean:!0,publicPath:t,asyncChunks:!0,charset:!0};let g={main:[e.polyfill&&f(o.corePath,"./polyfills/replace-children.mjs"),u("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?g={main:[e.entry]}:Object.keys(e.entry)&&(g=Object.assign(g,e.entry))),"string"==typeof g.main&&(g.main=[g.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let b=!1;e.cacheDirectory&&(b={type:"filesystem",store:"pack",allowCollectingMemory:!0,cacheDirectory:e.cacheDirectory,memoryCacheUnaffected:!0,name:[s,process.env.NODE_ENV].filter(Boolean).join("-"),version:i});let j=Object.assign({original:e.alias["@"],override:s&&d(s)},e.overrideResolve);export const commonConfig={devtool:e.devtool,entry:g,mode:l?"development":"production",stats:"errors-only",cache:b,infrastructureLogging:{level:"error"},target:"web",externalsPresets:e.externalsPresets,plugins:a,node:{global:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:l&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(u(y))||t.startsWith(u("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:c(e.buildHttp)?{allowedUris:[],lockfileLocation:h(o.httpCachePath,"http.lock"),cacheLocation:h(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!1,css:!1,outputModule:!1},resolve:{extensions:["...",".jsx",".ts",".tsx"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new r(j),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
|
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import
|
|
1
|
+
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import t from"./options/jsx-dom-expressions.mjs";import s from"./options/split-chunk.mjs";import i,{CUSTOMCONFIG as r}from"./paths.mjs";import{APPTYPE as n,FRAMEWORK as a,NODE_ENV as l,PACKAGENAME as m,isDev as p,isLibrary as c,isMobile as u,jsxImportSource as d,mainDirectory as f}from"./process-env.mjs";import{isFunction as h,resolveProgram as g}from"./utils/index.mjs";import x from"./utils/read-conf.mjs";import v from"./utils/setup-env.mjs";let P=["@moneko","neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app",".cache/http/data"],w={devtool:p?"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:v(l,n,a),basename:"/",publicPath:"/",rem:{designSize:u?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":g(f)},moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},cacheDirectory:i.webpackCachePath,devServer:{host:"localhost",port:3e3},htmlPluginOption:{},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:s,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:P,js:P,media:P,font:P,wasm:[]},mdx:{jsx:!1,development:p,jsxImportSource:d,providerImportSource:`@moneko/${a}/mdx`},jsxDomExpressions:t,bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{}};async function j(o,t){if(t&&e(o)){let e=(await x(o,t)).default;return h(e)?e(process):e}return{}}c&&(w.alias=Object.assign(w.alias,{"@pkg":i.componentsPath,[m]:i.componentsPath}));let k=w;(!1===(k=o(k,await j(i.configPath,"index"),await j(i.customConfigPath,r))).devtool||!1===k.sourceMap)&&(k.sourceMap=!1,k.devtool=!1),k.fixBrowserRouter&&k.htmlPluginOption&&(k.htmlPluginOption.tags||(k.htmlPluginOption.tags=[]),k.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=k;export const PUBLICPATH=CONFIG.publicPath||"/";
|