@moneko/core 3.44.5 → 3.44.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.
@@ -0,0 +1,11 @@
1
+ import webpack, { type WebpackPluginInstance } from 'webpack';
2
+ import CompressionPlugin, { type CompressionPluginOptions } from './plugin/compression.mjs';
3
+ import { CopyPlugin } from './plugin/copy.mjs';
4
+ import { HtmlMeta, HtmlPlugin } from './plugin/html-plugin.mjs';
5
+ import moduleFederation from './plugin/module-federation.mjs';
6
+ import { VirtualModuleWebpackPlugin } from './plugin/virtual-module.mjs';
7
+ import { CONFIG } from './config.mjs';
8
+ import { packageJson } from './process-env.mjs';
9
+ declare const compression: Partial<CompressionPluginOptions>;
10
+ declare const plugins: WebpackPluginInstance[];
11
+ export default plugins;
@@ -0,0 +1 @@
1
+ import e from"webpack";import t from"./plugin/compression.mjs";import{CopyPlugin as o}from"./plugin/copy.mjs";import{HtmlPlugin as i}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as p}from"./plugin/virtual-module.mjs";import{CONFIG as l}from"./config.mjs";import{packageJson as n}from"./process-env.mjs";let s="object"==typeof l.compression?l.compression:{},a=[...r,new p(l.virtualModule),new o(l.copy),new e.DefinePlugin({"process.env":JSON.stringify(l.env)}),new e.IgnorePlugin({resourceRegExp:/\/(__(tests|mocks)__|test|spec|e2e)\//}),...l.plugins,l.compression&&new t({algorithm:l.devServer.https?"brotli":"gzip",test:/\.(js|css|html|svg|ttf|woff|woff2|png|jpg|jpeg)$/,...s})].filter(Boolean);if(l.htmlPluginOption){let e={charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no","mobile-web-app-capable":"yes",renderer:"webkit",description:n.description,keywords:Array.isArray(n.keywords)?n.keywords.toString():"","http-equiv":"refresh",viewport:"width=device-width, initial-scale=1"};l.seo&&(e.relCanonical={rel:"canonical",href:`https://${l.seo.domain}${l.basename}`}),l.htmlPluginOption.meta&&Object.assign(e,l.htmlPluginOption.meta),a.push(new i({...l.htmlPluginOption,meta:e}))}if(l.fixBrowserRouter){let e=l.basename.split("/").filter(Boolean).length,t=`${Array(e).fill("..").join("/")+(e?"/":"")}404.html`,o=l.fixBrowserRouter.pathSegmentsToKeep??e;a.push(new i({filename:l.fixBrowserRouter.path??t,inject:!1,templateContent:()=>`<html lang="en"><head><title>Redirect</title><script>const pathKeep = ${o};const l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>`}))}l.sourceMap&&a.push(new e.SourceMapDevToolPlugin(l.sourceMap));export default a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.44.5",
3
+ "version": "3.44.6",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -525,7 +525,7 @@ export declare type ConfigType = {
525
525
  /**
526
526
  * 是否进行压缩
527
527
  */
528
- compression?: boolean | CompressionPluginOptions;
528
+ compression?: boolean | Partial<CompressionPluginOptions>;
529
529
  };
530
530
 
531
531
  /**