@moneko/core 2.0.53-beta.6 → 2.0.53-beta.8
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/build/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return A}});var e,s,r,t,o,l,a,n,i,u,c=b(require("mini-css-extract-plugin")),d=b(require("mini-svg-data-uri")),p=require("./common"),m=require("./has-pkg"),f=b(require("./modifyVars")),y=require("./process-env"),v=b(require("./swcrc")),g=b(require("./tsloader.config")),h=require("./utils");function x(e,s){(null==s||s>e.length)&&(s=e.length);for(var r=0,t=Array(s);r<s;r++)t[r]=e[r];return t}function b(e){return e&&e.__esModule?e:{default:e}}function I(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,s){if(e){if("string"==typeof e)return x(e,s);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,s)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var N="single-spa"===y.APPTYPE?p.PUBLICPATH:"../",P={loader:c.default.loader,options:{publicPath:"/"!==N?N:"../"}},O=(0,m.hasPkg)("@moneko/postcss"),$=O?require("@moneko/postcss"):{},q=O&&{loader:"postcss-loader",options:{postcssOptions:$}};y.DEV&&(P="style-loader");var C=I(p.CONFIG.cssModules).concat([y.pkgName,"neko-ui"]).map(h.resolveNodeModulesPath),j=[(0,h.resolveNodeModulesPath)(""+y.pkgName+"/lib/styles/eval/*.less")].concat(I(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(h.resolveProgramPath))),M=["components","example","mock","site","src"].map(h.resolveProgramPath),F=[P,{loader:"css-loader",options:{modules:{auto:function(e){for(var s=0,r=C.length;s<r;s++)if(e&&(null==e?void 0:e.includes(C[s])))return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e);return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},q,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!p.CONFIG.sourceMap,lessOptions:{modifyVars:f.default,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:j}}].filter(Boolean),G={loader:"tsc"===p.CONFIG.compiler?"ts-loader":"swc-loader",options:"tsc"===p.CONFIG.compiler?g.default:(0,v.default)(y.DEV)},A={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:F,include:M.concat((null==(e=p.CONFIG.rulesInclude)?void 0:null==(s=e.less)?void 0:s.map(h.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[P,"css-loader",q,"css-unicode-loader"].filter(Boolean),include:M.concat((null==(r=p.CONFIG.rulesInclude)?void 0:null==(t=r.css)?void 0:t.map(h.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:M.concat((null==(o=p.CONFIG.rulesInclude)?void 0:null==(l=o.media)?void 0:l.map(h.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:M.concat((null==(a=p.CONFIG.rulesInclude)?void 0:null==(n=a.fonts)?void 0:n.map(h.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(e){return(0,d.default)("string"!=typeof e?e.toString():e)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:I(p.CONFIG.prefixJsLoader).concat([G]).filter(Boolean),include:M.concat((null==(i=p.CONFIG.rulesInclude)?void 0:null==(u=i.js)?void 0:u.map(h.resolveNodeModulesPath))||[])},{test:/\.mdx?$/,use:I(p.CONFIG.prefixJsLoader).concat([G,{loader:"@mdx-js/loader",options:{rehypePlugins:[[require("@mapbox/rehype-prism"),{ignore:!0}],require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:M,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]}].concat(I(p.CONFIG.moduleRules))};
|
package/build/webpack.common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(exports,{outputConfig:function(){return T},default:function(){return R}});var e,t,r=j(require("fs")),n=require("path"),a=j(require("add-asset-html-webpack-plugin")),s=j(require("html-webpack-plugin")),l=require("webpack"),o=j(require("webpackbar")),i=require("./common"),u=j(require("./done")),c=j(require("./envFlags")),p=j(require("./html-add-entry-attr")),d=j(require("./html-plugin-option")),m=require("./module-federation"),f=j(require("./module.config")),g=require("./process-env"),h=require("./seo"),y=require("./utils");function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function j(e){return e&&e.__esModule?e:{default:e}}function O(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}for(var A=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],v=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],C=r.default.readdirSync(g.PROGRAMPATH),w=!1,G=!1,N=0,I=C.length;N<I;N++)v.includes(C[N])&&(G=!0),A.includes(C[N])&&(w=!0);w||(w=g.hasEslintConfig),G||(G=g.hasStylelintConfig);var x=G?require("stylelint-webpack-plugin"):null,F=w?require("eslint-webpack-plugin"):null,E={"@":(0,y.resolveProgramPath)("src")};Object.assign(E,i.CONFIG.alias),"library"===g.APPTYPE&&Object.assign(E,((e={"@":(0,y.resolveProgramPath)("site"),"@pkg":(0,y.resolveProgramPath)("components")})[g.PACKAGENAME]=(0,y.resolveProgramPath)("components"),e));var q=i.CONFIG.assetHtml.map(function(e){return P({publicPath:""},e)}),T={path:(0,y.resolveProgramPath)("library"===g.APPTYPE?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:g.PACKAGENAME,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:"webpackJsonp_"+g.PACKAGENAME,pathinfo:!1,clean:!0,publicPath:i.PUBLICPATH},k=(0,n.join)(__dirname,"../lib/packages/"+i.ENTRYPATH[g.APPTYPE]+"/index.js");"single-component"===g.APPTYPE&&(Object.assign(E,((t={})[g.PACKAGENAME]=(0,y.resolveProgramPath)("umd"),t)),k=(0,y.resolveProgramPath)(g.DEV?"example/index.ts":"src/index.ts"),T.path=(0,y.resolveProgramPath)(g.DEV?"dist":"umd"),T.filename="index.js",T.library=g.PACKAGENAME,T.libraryTarget="umd",T.libraryExport="default");var M={main:k};i.CONFIG.entry&&("string"==typeof i.CONFIG.entry?M=i.CONFIG.entry:Object.keys(i.CONFIG.entry)&&Object.assign(M,i.CONFIG.entry)),i.CONFIG.output&&("string"==typeof i.CONFIG.output?T.path=i.CONFIG.output:Object.keys(i.CONFIG.output)&&Object.assign(T,i.CONFIG.output));var S=i.CONFIG.routeBaseName.split("/").filter(Boolean).length,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(exports,{outputConfig:function(){return T},default:function(){return R}});var e,t,r=j(require("fs")),n=require("path"),a=j(require("add-asset-html-webpack-plugin")),s=j(require("html-webpack-plugin")),l=require("webpack"),o=j(require("webpackbar")),i=require("./common"),u=j(require("./done")),c=j(require("./envFlags")),p=j(require("./html-add-entry-attr")),d=j(require("./html-plugin-option")),m=require("./module-federation"),f=j(require("./module.config")),g=require("./process-env"),h=require("./seo"),y=require("./utils");function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function j(e){return e&&e.__esModule?e:{default:e}}function O(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}for(var A=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],v=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],C=r.default.readdirSync(g.PROGRAMPATH),w=!1,G=!1,N=0,I=C.length;N<I;N++)v.includes(C[N])&&(G=!0),A.includes(C[N])&&(w=!0);w||(w=g.hasEslintConfig),G||(G=g.hasStylelintConfig);var x=G?require("stylelint-webpack-plugin"):null,F=w?require("eslint-webpack-plugin"):null,E={"@":(0,y.resolveProgramPath)("src")};Object.assign(E,i.CONFIG.alias),"library"===g.APPTYPE&&Object.assign(E,((e={"@":(0,y.resolveProgramPath)("site"),"@pkg":(0,y.resolveProgramPath)("components")})[g.PACKAGENAME]=(0,y.resolveProgramPath)("components"),e));var q=i.CONFIG.assetHtml.map(function(e){return P({publicPath:""},e)}),T={path:(0,y.resolveProgramPath)("library"===g.APPTYPE?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:g.PACKAGENAME,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:"webpackJsonp_"+g.PACKAGENAME,pathinfo:!1,clean:!0,publicPath:i.PUBLICPATH},k=(0,n.join)(__dirname,"../lib/packages/"+i.ENTRYPATH[g.APPTYPE]+"/index.js");"single-component"===g.APPTYPE&&(Object.assign(E,((t={})[g.PACKAGENAME]=(0,y.resolveProgramPath)("umd"),t)),k=(0,y.resolveProgramPath)(g.DEV?"example/index.ts":"src/index.ts"),T.path=(0,y.resolveProgramPath)(g.DEV?"dist":"umd"),T.filename="index.js",T.library=g.PACKAGENAME,T.libraryTarget="umd",T.libraryExport="default");var M={main:k};i.CONFIG.entry&&("string"==typeof i.CONFIG.entry?M=i.CONFIG.entry:Object.keys(i.CONFIG.entry)&&Object.assign(M,i.CONFIG.entry)),i.CONFIG.output&&("string"==typeof i.CONFIG.output?T.path=i.CONFIG.output:Object.keys(i.CONFIG.output)&&Object.assign(T,i.CONFIG.output));var S=i.CONFIG.routeBaseName.split("/").filter(Boolean).length,_=Array(S).fill("..").join("/")+(S?"/":"")+"404.html",K=i.CONFIG.fixBrowserRouter||{},B=K.pathSegmentsToKeep,Y=void 0===B?S:B,D=K.path,R={entry:M,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new l.AutomaticPrefetchPlugin].concat(O(m.moduleFederation),[F&&new F({threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),x&&new x({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/","__tests__/"]}),new s.default(d.default),i.CONFIG.fixBrowserRouter&&new s.default({filename:void 0===D?_:D,inject:!1,templateContent:function(){return"<html html><head><title>"+d.default.title+"</title><script>var pathSegmentsToKeep = "+(Y||S)+";var l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>"}}),new a.default(q),"single-spa"===g.APPTYPE&&new p.default(function(e){return!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))}),new l.DefinePlugin(c.default),new l.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),i.CONFIG.sourceMap&&new l.SourceMapDevToolPlugin(i.CONFIG.sourceMap),new o.default({name:"编译中",color:"#6f42c1"}),new u.default({done:function(){!g.DEV&&i.CONFIG.seo&&(0,h.seo)(),null==i.CONFIG.done||i.CONFIG.done()}})],O(i.CONFIG.plugins)).filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:E,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:f.default,externals:i.CONFIG.externals,output:T};
|