@moneko/core 3.0.0-beta.87 → 3.0.0-beta.88

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.
@@ -1 +1 @@
1
- import e from"fs";import t from"add-asset-html-webpack-plugin";import s from"html-webpack-plugin";import o from"webpack";import n from"webpackbar";import"./cleanup.js";import{CONFIG as l,ENTRYPATH as i,PUBLICPATH as a}from"./common.js";import r from"./define.js";import"./docs.js";import p from"./done.js";import m from"./html-add-entry-attr.js";import c from"./html-plugin-option.js";import{moduleFederation as u}from"./module-federation.js";import d from"./module.config.js";import{APPTYPE as f,DEV as j,FRAMEWORK as g,PACKAGENAME as h,PROGRAMPATH as b,hasEslintConfig as y,hasStylelintConfig as w}from"./process-env.js";import"./routes.js";import{seo as x}from"./seo.js";import{resolveNodeModulesPath as k,resolveProgramPath as v}from"./utils.js";import O from"./virtual-module-plugin.js";import C from"./virtual-modules.js";let P=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],$=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],A=e.readdirSync(b),B=!1,S=!1;for(let e=0,t=A.length;e<t;e++)$.includes(A[e])&&(S=!0),P.includes(A[e])&&(B=!0);B||(B=y),S||(S=w);let T=S?(await import("stylelint-webpack-plugin")).default:null,M=B?(await import("eslint-webpack-plugin")).default:null;export const alias={"@":v("src")};Object.assign(alias,l.alias),"library"===f&&Object.assign(alias,{"@":v("site"),"@pkg":v("components"),[h]:v("components")});let D=l.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:v("library"===f?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name][hash][ext][query]",library:{name:h,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${h}`,pathinfo:j,clean:!0,publicPath:a};let K=k(`@moneko/${g}/lib/packages/${i[f]}/index.js`);"single-component"===f&&(Object.assign(alias,{[h]:v("umd")}),K=v(j?"example/index.ts":"src/index.ts"),outputConfig.path=v(j?"dist":"umd"),outputConfig.filename="index.js",outputConfig.globalObject="this",outputConfig.library={export:"default",name:h,type:"umd",umdNamedDefine:!0});let L={main:K};l.entry&&("string"==typeof l.entry?L=l.entry:Object.keys(l.entry)&&Object.assign(L,l.entry)),l.output&&("string"==typeof l.output?outputConfig.path=l.output:Object.keys(l.output)&&Object.assign(outputConfig,l.output));let W=l.routeBaseName.split("/").filter(Boolean).length,F=`${Array(W).fill("..").join("/")+(W?"/":"")}404.html`,{pathSegmentsToKeep:N=W,path:R=F}=l.fixBrowserRouter||{},_={entry:L,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new o.AutomaticPrefetchPlugin,...u,M&&new M({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),T&&new T({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),l.htmlPluginOption&&new s(c),l.fixBrowserRouter&&new s({filename:R,inject:!1,templateContent:()=>`<html html><head><title>${c.title}</title><script>var pathSegmentsToKeep = ${N||W};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 t(D),"single-spa"===f&&new m(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new o.DefinePlugin(r),new o.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),l.sourceMap&&new o.SourceMapDevToolPlugin(l.sourceMap),l.bar&&new n(l.bar),new p({done:()=>{!j&&l.seo&&x(),l.done?.(),j||setTimeout(()=>{process.exit(0)},0)}}),new O(C),...l.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:alias,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:d,externals:l.externals,output:outputConfig};export default _;
1
+ import e from"fs";import t from"add-asset-html-webpack-plugin";import s from"html-webpack-plugin";import o from"webpack";import n from"webpackbar";import"./cleanup.js";import{CONFIG as l,ENTRYPATH as i,PUBLICPATH as a}from"./common.js";import r from"./define.js";import"./docs.js";import p from"./done.js";import m from"./html-add-entry-attr.js";import c from"./html-plugin-option.js";import{moduleFederation as u}from"./module-federation.js";import d from"./module.config.js";import{APPTYPE as f,DEV as j,FRAMEWORK as g,PACKAGENAME as h,PROGRAMPATH as b,hasEslintConfig as y,hasStylelintConfig as w}from"./process-env.js";import"./routes.js";import{seo as x}from"./seo.js";import{resolveNodeModulesPath as k,resolveProgramPath as v}from"./utils.js";import O from"./virtual-module-plugin.js";import C from"./virtual-modules.js";let P=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],$=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],A=e.readdirSync(b),B=!1,S=!1;for(let e=0,t=A.length;e<t;e++)$.includes(A[e])&&(S=!0),P.includes(A[e])&&(B=!0);B||(B=y),S||(S=w);let T=S?(await import("stylelint-webpack-plugin")).default:null,M=B?(await import("eslint-webpack-plugin")).default:null;export const alias={"@":v("src")};Object.assign(alias,l.alias),"library"===f&&Object.assign(alias,{"@":v("site"),"@pkg":v("components"),[h]:v("components")});let D=l.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:v("library"===f?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name][hash][ext][query]",library:{name:h,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${h}`,pathinfo:j,clean:!0,publicPath:a};let K=k(`@moneko/${g}/lib/packages/${i[f]}/index.js`);"single-component"===f&&(Object.assign(alias,{[h]:v("umd")}),K=v(j?"example/index.ts":"src/index.ts"),outputConfig.path=v(j?"dist":"umd"),outputConfig.filename="index.js",outputConfig.globalObject="this",outputConfig.library={export:"default",name:h,type:"umd",umdNamedDefine:!0});let L={main:K};l.entry&&("string"==typeof l.entry?L=l.entry:Object.keys(l.entry)&&Object.assign(L,l.entry)),l.output&&("string"==typeof l.output?outputConfig.path=l.output:Object.keys(l.output)&&Object.assign(outputConfig,l.output));let W=l.routeBaseName.split("/").filter(Boolean).length,F=`${Array(W).fill("..").join("/")+(W?"/":"")}404.html`,{pathSegmentsToKeep:N=W,path:R=F}=l.fixBrowserRouter||{},_={entry:L,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new o.AutomaticPrefetchPlugin,...u,M&&new M({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),T&&new T({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),l.htmlPluginOption&&new s(c),l.fixBrowserRouter&&new s({filename:R,inject:!1,templateContent:()=>`<html html><head><title>${c.title}</title><script>var pathSegmentsToKeep = ${N||W};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 t(D),"single-spa"===f&&new m(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new o.DefinePlugin(r),new o.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),l.sourceMap&&new o.SourceMapDevToolPlugin(l.sourceMap),l.bar&&new n(l.bar),new p({done:()=>{!j&&l.seo&&x(),l.done?.(),j||setTimeout(()=>{process.exit(0)},32)}}),new O(C),...l.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:alias,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:d,externals:l.externals,output:outputConfig};export default _;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.0.0-beta.87",
3
+ "version": "3.0.0-beta.88",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",