@moneko/core 3.0.0-beta.27 → 3.0.0-beta.28
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.js +2 -2
- package/package.json +1 -1
package/lib/common.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from"fs";import t from"path";import o from"readline";import s from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as l,FRAMEWORK as r,jsxImportSource as a,pkgName as c,PROGRAMPATH as p}from"./process-env.js";import{isFunction as m,readConf as u}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};let d=[`@moneko/${r}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],f={chunks:"all",minSize:1024,minChunks:1};"single-component"===n&&(f=!1);let
|
|
1
|
+
import e from"fs";import t from"path";import o from"readline";import s from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as l,FRAMEWORK as r,jsxImportSource as a,pkgName as c,PROGRAMPATH as p}from"./process-env.js";import{isFunction as m,readConf as u}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};let d=[`@moneko/${r}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],f={chunks:"all",minSize:1024,minChunks:1};"single-component"===n&&(f=!1);let g={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===n?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:p+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${c}/template/index.html`,favicon:`./node_modules/${c}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:f,runtimeChunk:"single-component"!==n&&"single",moduleFederation:[],rulesInclude:{less:d,css:d,js:d,media:d,fonts:d},mdx:{jsxImportSource:a,remarkPlugins:[],rehypePlugins:[]}};export const log=e=>{o.cursorTo(process.stdout,0),process.stdout.write(e)};let h=g,y=null,b={},w={};try{y=t.join(p,"./config/index.ts"),e.accessSync(y,e.constants.R_OK)}catch(e){y=null}if(y)try{let e=(await u(y,"index")).default;b=m(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}if(l){let o=null;try{o=t.join(p,`./config/${l}.ts`),e.accessSync(o,e.constants.R_OK)}catch(e){o=null}if(null!==o)try{let e=(await u(o,l)).default;w=m(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}}"tsc"!==(h=i(h,b,w)).compiler||(h.minifier.js||Object.assign(h.minifier,{js:{type:"terser"}}),h.minifier.css||Object.assign(h.minifier,{css:{type:"cssnano"}})),!1===h.devtool&&(h.sourceMap=!1),!1===h.sourceMap&&(h.devtool=!1),h.fixBrowserRouter&&(h.htmlPluginOption.tags||(h.htmlPluginOption.tags=[]),h.htmlPluginOption.tags.push({textContent:`
|
|
2
2
|
(function(l) {
|
|
3
3
|
if (l.search[1] === '/' ) {
|
|
4
4
|
var decoded = l.search.slice(1).split('&').map(function(s) {
|
|
@@ -9,4 +9,4 @@ import e from"fs";import t from"path";import o from"readline";import s from"chal
|
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
11
|
}(window.location))
|
|
12
|
-
`}));export const CONFIG=
|
|
12
|
+
`}));export const CONFIG=h;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,log};
|