@moneko/core 3.0.1 → 3.0.2
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 +1 -1
- package/package.json +1 -1
package/lib/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{accessSync as e,constants as t}from"fs";import{join as o}from"path";import s from"readline";import r from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as a,FRAMEWORK as l,PACKAGENAME as c,PROGRAMPATH as m,jsxImportSource as p,pkgName as u}from"./process-env.js";import{isFunction as d,readConf as h,resolveProgramPath as f}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site",backstage:"backstage",micro:"micro",library:"library"};let g=["@moneko/core",`@moneko/${l}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app"],x={library:{"@":f("site"),"@pkg":f("components"),[c]:f("components")},mobile:{},site:{},backstage:{},micro:{}},b={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:!1,entry:{},minifier:{js:{},css:{}},sourceMap:{filename:"[file].map",publicPath:""},env:{},basename:"/",publicPath:"/",rem:{designSize:"mobile"===n?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":f("src")},x[n]),moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:`${m}/node_modules/.temp_cache`,devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${u}/template/index.html`,favicon:`./node_modules/${u}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:{chunks:"all",minSize:1024,minChunks:1,cacheGroups:{route:{test:/[\\/].git[\\/]router/,priority:-10,reuseExistingChunk:!0,name:"route"},example:{test:/[\\/].git[\\/]example/,priority:-10,reuseExistingChunk:!0,name:"example"}}},runtimeChunk:"single",moduleFederation:[],rulesInclude:{less:g,css:g,js:g,media:g,fonts:g},mdx:{jsxImportSource:p,useDynamicImport:!0,remarkPlugins:[],rehypePlugins:[]},jsxDomExpressions:{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1},bar:{name:"编译中",color:"#6f42c1"},virtualModule:{},normalizeCss:!0,externalsPresets:{}};export const log=e=>{s.cursorTo(process.stdout,0),process.stdout.write(e)};let y=b,C=null,w={},k={};try{C=o(m,"./config/index.ts"),e(C,t.R_OK)}catch(e){C=null}if(C)try{let e=(await h(C,"index")).default;w=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}if(a){let s=null;try{s=o(m,`./config/${a}.ts`),e(s,t.R_OK)}catch(e){s=null}if(null!==s)try{let e=(await h(s,a)).default;k=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}}"tsc"===(y=i(y,w,k)).compiler&&y.minifier&&(y.minifier.js||Object.assign(y.minifier,{js:{type:"terser"}}),y.minifier.css||Object.assign(y.minifier,{css:{type:"cssnano"}})),!1===y.devtool&&(y.sourceMap=!1),!1===y.sourceMap&&(y.devtool=!1),y.fixBrowserRouter&&y.htmlPluginOption&&(y.htmlPluginOption.tags||(y.htmlPluginOption.tags=[]),y.htmlPluginOption.tags.push({textContent:'!function(n){var a=location.search.slice(1);if("/"===a[0]){for(var o=[],c=decodeURIComponent(a).split("&"),e=0,t=c.length;e<t;e++)o.push(c[e].replace(/~and~/g,"&"));var l=o.join("
|
|
1
|
+
import{accessSync as e,constants as t}from"fs";import{join as o}from"path";import s from"readline";import r from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as a,FRAMEWORK as l,PACKAGENAME as c,PROGRAMPATH as m,jsxImportSource as p,pkgName as u}from"./process-env.js";import{isFunction as d,readConf as h,resolveProgramPath as f}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site",backstage:"backstage",micro:"micro",library:"library"};let g=["@moneko/core",`@moneko/${l}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app"],x={library:{"@":f("site"),"@pkg":f("components"),[c]:f("components")},mobile:{},site:{},backstage:{},micro:{}},b={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:!1,entry:{},minifier:{js:{},css:{}},sourceMap:{filename:"[file].map",publicPath:""},env:{},basename:"/",publicPath:"/",rem:{designSize:"mobile"===n?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":f("src")},x[n]),moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:`${m}/node_modules/.temp_cache`,devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${u}/template/index.html`,favicon:`./node_modules/${u}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:{chunks:"all",minSize:1024,minChunks:1,cacheGroups:{route:{test:/[\\/].git[\\/]router/,priority:-10,reuseExistingChunk:!0,name:"route"},example:{test:/[\\/].git[\\/]example/,priority:-10,reuseExistingChunk:!0,name:"example"}}},runtimeChunk:"single",moduleFederation:[],rulesInclude:{less:g,css:g,js:g,media:g,fonts:g},mdx:{jsxImportSource:p,useDynamicImport:!0,remarkPlugins:[],rehypePlugins:[]},jsxDomExpressions:{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1},bar:{name:"编译中",color:"#6f42c1"},virtualModule:{},normalizeCss:!0,externalsPresets:{}};export const log=e=>{s.cursorTo(process.stdout,0),process.stdout.write(e)};let y=b,C=null,w={},k={};try{C=o(m,"./config/index.ts"),e(C,t.R_OK)}catch(e){C=null}if(C)try{let e=(await h(C,"index")).default;w=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}if(a){let s=null;try{s=o(m,`./config/${a}.ts`),e(s,t.R_OK)}catch(e){s=null}if(null!==s)try{let e=(await h(s,a)).default;k=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}}"tsc"===(y=i(y,w,k)).compiler&&y.minifier&&(y.minifier.js||Object.assign(y.minifier,{js:{type:"terser"}}),y.minifier.css||Object.assign(y.minifier,{css:{type:"cssnano"}})),!1===y.devtool&&(y.sourceMap=!1),!1===y.sourceMap&&(y.devtool=!1),y.fixBrowserRouter&&y.htmlPluginOption&&(y.htmlPluginOption.tags||(y.htmlPluginOption.tags=[]),y.htmlPluginOption.tags.push({textContent:'!function(n){var a=location.search.slice(1);if("/"===a[0]){for(var o=[],c=decodeURIComponent(a).split("&"),e=0,t=c.length;e<t;e++)o.push(c[e].replace(/~and~/g,"&"));var l=o.join("?");l!==a&&window.history.replaceState(null,null,"".concat(n.pathname.slice(0,-1),"?").concat(l).concat(n.hash))}}(window.location);'}));export const CONFIG=y;export const PUBLICPATH=CONFIG.publicPath||"/";export let hasCustomRouter=!1;try{e(o(CONFIG.alias["@"],"./router/index.ts"),t.R_OK),hasCustomRouter=!0}catch(e){hasCustomRouter=!1}global.NEKOCLICONFIG={CONFIG,log};
|