@moneko/core 3.17.28-beta.4 → 3.17.28-beta.6
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/build/common.mjs +1 -1
- package/lib/common.mjs +1 -1
- package/lib/module.config.mjs +1 -1
- package/package.json +1 -1
package/lib/build/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as
|
|
1
|
+
import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as r}from"webpack-bundle-analyzer";import{merge as m}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as o}from"../config.mjs";import{getMinifyOption as s}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as l}from"../plugin/lightningcss-plugin.mjs";import{getLightningCssTargets as p}from"../polyfills/targets.mjs";let{optimize:{MinChunkSizePlugin:a}}=n,u=[];o.minifier&&(u.push(new i(s(o.minifier.type,o.minifier.options))),u.push(new l({targets:p()})));let c=m(t,{plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),o.splitChunk&&new a({minChunkSize:1e4}),o.bundleAnalyzer&&new r({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...o.bundleAnalyzer})].filter(Boolean),optimization:{concatenateModules:!0,realContentHash:!0,sideEffects:!0,usedExports:!0,providedExports:!0,emitOnErrors:!0,flagIncludedChunks:!0,innerGraph:!1,mangleExports:"deterministic",splitChunks:o.splitChunk,runtimeChunk:o.runtimeChunk,chunkIds:"deterministic",moduleIds:"deterministic",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!1,minimize:!0,minimizer:u}});export default c;
|
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 a from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as r,isDev as l,isLibrary as p}from"./process-env.mjs";import{isObject as m,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{join as h,resolve as d,extname as f}from"path";import{exampleModuleName as g}from"./vm/example.mjs";export const outputConfig={path:u(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${l?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=f(e.filename||"").substring(1);return`assets/${t?`${t}/`:""}[name]${"js"===t?"":"[hash]"}[ext]`},library:{name:i,type:"this"},globalObject:"this",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:l,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let y={main:[e.polyfill&&h(o.corePath,"./polyfills/replace-children.mjs"),c("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?y={main:[e.entry]}:Object.keys(e.entry)&&(y=Object.assign(y,e.entry))),"string"==typeof y.main&&(y.main=[y.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let b=!1;m(e.cache)&&(b=Object.assign({type:"filesystem",store:"pack",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:[s,process.env.NODE_ENV].filter(Boolean).join("-"),version:r,profile:!0},e.cache));let j=Object.assign({original:e.alias["@"],override:s&&u(s)},e.overrideResolve);export const commonConfig={name:"client",target:"web",devtool:e.devtool,entry:y,mode:l?"development":"production",stats:"errors-only",cache:b,infrastructureLogging:{level:"error"},performance:{maxAssetSize:307200,maxEntrypointSize:512e3,assetFilter:e=>e.endsWith(".js")},externalsPresets:e.externalsPresets,plugins:n,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(c(g))||t.startsWith(c("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:m(e.buildHttp)?{allowedUris:[],lockfileLocation:d(o.httpCachePath,"http.lock"),cacheLocation:d(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!0,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 a(j),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
|
|
1
|
+
import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as s}from"./paths.mjs";import a from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as r,isDev as l,isLibrary as p}from"./process-env.mjs";import{isObject as m,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{join as h,resolve as d,extname as f}from"path";import{exampleModuleName as g}from"./vm/example.mjs";export const outputConfig={path:u(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${l?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=f(e.filename||"").substring(1);return`assets/${t?`${t}/`:""}[name]${"js"===t?"":"[hash]"}[ext]`},library:{name:i,type:"this"},globalObject:"this",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:l,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let y={main:[e.polyfill&&h(o.corePath,"./polyfills/replace-children.mjs"),c("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?y={main:[e.entry]}:Object.keys(e.entry)&&(y=Object.assign(y,e.entry))),"string"==typeof y.main&&(y.main=[y.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let b=!1;m(e.cache)&&(b=Object.assign({type:"filesystem",store:"pack",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,idleTimeoutForInitialStore:0,cacheUnaffected:!0,name:[s,process.env.NODE_ENV].filter(Boolean).join("-"),version:r,profile:!0},e.cache));let j=Object.assign({original:e.alias["@"],override:s&&u(s)},e.overrideResolve);export const commonConfig={name:"client",target:"web",devtool:e.devtool,entry:y,mode:l?"development":"production",stats:"errors-only",cache:b,infrastructureLogging:{level:"error"},performance:{maxAssetSize:307200,maxEntrypointSize:512e3,assetFilter:e=>e.endsWith(".js")},externalsPresets:e.externalsPresets,plugins:n,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(c(g))||t.startsWith(c("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:m(e.buildHttp)?{allowedUris:[],lockfileLocation:d(o.httpCachePath,"http.lock"),cacheLocation:d(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!0,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 a(j),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
|
package/lib/module.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e;import{CONFIG as s}from"./config.mjs";import o from"./options/modify-vars.mjs";import t from"./options/swcrc.mjs";import r,{CUSTOMCONFIG as
|
|
1
|
+
let e;import{CONFIG as s}from"./config.mjs";import o from"./options/modify-vars.mjs";import t from"./options/swcrc.mjs";import r,{CUSTOMCONFIG as n}from"./paths.mjs";import{getLightningCssTargets as a}from"./polyfills/targets.mjs";import{FRAMEWORK as i,isDev as m,isLibrary as l}from"./process-env.mjs";import d from"./rule.mjs";import c from"./utils/has-pkg.mjs";import{node_modules as p,resolveProgram as u}from"./utils/index.mjs";import f from"./utils/svg-to-data-uri.mjs";import{comment as j,getCommentPath as y}from"./vm/docs.mjs";import v from"./vm/generate-doc.mjs";import g from"./options/css-extract.mjs";import{saveFileSync as x}from"@moneko/utils";import h from"./utils/reactive-object.mjs";import _ from"./options/reslove.mjs";import w from"./utils/require.mjs";import{sep as M}from"path";let L={loader:`${r.corePath}/loader/lightningcss.cjs`,options:{sourceMap:!!s.sourceMap,analyzeDependencies:!1,targets:a(),drafts:{nesting:!0,customMedia:!0},errorRecovery:!1,unusedSymbols:[],rem:!!s.rem}},P={loader:_.lessLoader,options:{sourceMap:!!s.sourceMap,lessOptions:{modifyVars:o,javascriptEnabled:!0}}};function k(e){try{let s=w.resolve(e).split(M),o=s.lastIndexOf("node_modules");return -1!==o?s.slice(0,o).join(M):s.join(M)}catch(s){return p(e)}}let O=[...s.cssModules,`@moneko/${i}`,"neko-ui"].map(e=>k(e)).filter(e=>null!==e),$=["components","example","mock","site","src","server"].map(u);function I(e){return[...$,...s.rulesInclude?.[e]?.map(e=>k(e)).filter(e=>null!==e)||[]]}n&&$.push(u(n)),s.overrideResolve&&s.overrideResolve.override&&$.push(s.overrideResolve.override);let b=I("css"),R=I("js"),B=I("media"),C=I("wasm"),D=I("font");_.sassLoader&&(e={loader:_.sassLoader,options:{implementation:await import("sass"),sassOptions:{}}});let S=l&&m&&{test:d.tsdoc,include:s.alias["@pkg"],exclude:[d.node_modules,d.__tests__],enforce:"pre",loader:`${r.corePath}/loader/ts-doc.cjs`,options:{comment:j,generateDoc:v,getCommentPath:y}},z=[{resourceQuery:/raw/i,type:"asset/source"},{resourceQuery:/url/i,type:"asset/resource",generator:{filename:e=>{let s=e.filename;return s&&s.endsWith("wasm?url")?"wasm/[name][ext]":"assets/[name][ext]"}}},{test:d.wasm,type:"webassembly/async",include:C},{test:d.txt,type:"asset/source"},{test:d.ico,type:"asset/inline",include:B},{test:d.svg,type:"asset/inline",generator:{dataUrl:e=>f(e.toString())},include:B},{test:d.image,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/images/[name][ext]"},include:B},{test:d.video,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[name][ext]"},include:B},{test:d.font,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[name][ext]"},include:D}],J=s.prefixJsLoader.filter(Boolean)||[];!m&&c("@moneko/css")&&J.unshift(`${r.corePath}/loader/css-in-js-minify.cjs`);let N=new h({});function Q(e){N.setData(`${e.resourcePath}.d.ts`,e.exports.map(({name:e,value:s})=>`export const ${e}: '${s}';`).join("\n")+"\n")}N.on("change",(e,s)=>{x(e,s)});export default(o=>{let n={loader:_.swcLoader,options:t(o)},a={loader:_.cssLoader,options:{modules:{auto:e=>{if(e){for(let s=0,o=O.length;s<o;s++)if(e.includes(O[s]))return d.css_module.test(e)}return d.node_modules_css_module.test(e)},localIdentName:"[path][name]_[local]",exportLocalsConvention:"dashesOnly",exportOnlyLocals:o,getJSON:s.cssModuleDefinition?Q:void 0},importLoaders:2}};return{parser:{javascript:{commonjsMagicComments:!0,dynamicImportMode:"lazy",dynamicImportPrefetch:!1,dynamicImportPreload:!1,importMeta:!0,importMetaContext:!0}},noParse:s.noParse,rules:[!1!==s.htmlPluginOption&&S,{oneOf:[...z,{test:d.js,use:[...J,n],include:R},{test:d.css,use:[g,_.cssLoader,L],include:b},e&&{test:d.scss,use:[g,a,L,e],include:b},{test:d.less,use:[g,a,L,P],include:b},{test:d.markdown,use:[...J,{loader:`${r.corePath}/loader/mdx.cjs`,options:s.mdx}],exclude:[d.node_modules]}].filter(Boolean)},...s.moduleRules].filter(Boolean)}});
|