@moneko/core 4.1.1 → 4.1.3
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.mjs +1 -1
- package/package.json +1 -1
package/lib/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extname as e,join as t,resolve as s}from"node:path";import o,{config_files as a,CUSTOMCONFIG as n
|
|
1
|
+
import{extname as e,join as t,resolve as s}from"node:path";import o,{config_files as a,CUSTOMCONFIG as n}from"./commom/paths.mjs";import i from"./commom/rule.mjs";import{OverrideResolverPlugin as r}from"./plugin/override-resolve.mjs";import{isObject as l,resolveProgram as m}from"./utils/index.mjs";import{CONFIG as c}from"./config.mjs";import p from"./plugins.config.mjs";import{app_schema as u,CACHE_NAME as h,isDev as d,isLibrary as f,packageJson as g,projectNameCamelCase as y}from"./process-env.mjs";export const outputConfig={path:m(f?"docs":"dist"),filename:e=>e.filename?.includes(".worker")?"worker/[name].js":"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",cssFilename:"style/[contenthash].css",cssChunkFilename:"style/[contenthash].chunk.css",assetModuleFilename:t=>{let s=e(t.filename||"").substring(1);return`assets/${s}/[hash][ext]`},library:{name:`${y}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${g.name}`,pathinfo:d,clean:!0,publicPath:c.publicPath,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],uniqueName:`${y}`};let b={main:[`${u}:entry`]},j=[t(o.corePath,"./polyfills/public-path.mjs")];if(d&&c.refresh&&c.env.injectRemoteReactRefresh&&j.push(t(o.corePath,"./polyfills/inject-react-refresh.mjs")),c.polyfill&&j.push(t(o.corePath,"./polyfills/replace-children.mjs")),c.entry&&("string"==typeof c.entry?b={...b,main:[c.entry]}:Object.keys(c.entry)&&(b=Object.assign(b,c.entry))),"string"==typeof b.main?b.main=[...j,b.main]:Array.isArray(b.main)&&(b.main=[...j,...b.main]),c.output){if("string"==typeof c.output)outputConfig.path=c.output;else if(Object.keys(c.output)){let e=c.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof c.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let C={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:h,version:`${g.version}`,buildDependencies:{config:a},maxMemoryGenerations:1};!1===c.cache?C=!1:l(c.cache)&&(C=Object.assign(C,c.cache));let v={},P={imports:!0,entries:!0,test:e=>{let s=e.nameForCondition();return!!(s&&(/^[a-z][a-z0-9]*:.+$/.test(s)||s?.startsWith(t(o.programPath,"src"))||s?.startsWith(t(o.programPath,"site"))||s?.startsWith(o.componentsPath)))}};c.lazyCompilation&&d&&"true"!==process.env.IS_BUILD?l(c.lazyCompilation)?Object.assign(v,P,c.lazyCompilation):Object.assign(v,P):v=!1;export const commonConfig={name:"client",target:"web",devtool:c.devtool,entry:b,mode:c.mode??"production",cache:C,snapshot:{immutablePaths:[o.pnpmNodeModules,o.denoNodeModules,i.node_modules],managedPaths:[o.pnpmNodeModules,o.denoNodeModules,i.node_modules],resolveBuildDependencies:{timestamp:!0,hash:!0},resolve:{timestamp:!0,hash:!0},module:{timestamp:!0,hash:!0},buildDependencies:{timestamp:!0,hash:!0},contextModule:{timestamp:!0,hash:!0}},stats:"errors-only",infrastructureLogging:{level:"error"},externalsPresets:c.externalsPresets,plugins:p,node:{global:!1,__filename:!1,__dirname:!1},experiments:{asyncWebAssembly:!0,cacheUnaffected:!0,lazyCompilation:v,buildHttp:l(c.buildHttp)?{allowedUris:[],lockfileLocation:s(o.httpCachePath,"http.lock"),cacheLocation:s(o.httpCachePath,"data"),upgrade:!0,...c.buildHttp}:c.buildHttp,backCompat:!0,futureDefaults:!0,css:!0,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:c.alias,modules:[o.nodeModules,o.pnpmNodeModules,o.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:c.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:c.externals,output:outputConfig,recordsPath:c.recordsPath};c.overrideResolve&&commonConfig.resolve.plugins.push(new r(Object.assign({original:c.alias["@"],override:n&&m(n)},c.overrideResolve)));
|