@moneko/core 3.9.3 → 3.9.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/config.js +1 -1
- package/lib/loader/lightningcss.cjs +1 -0
- package/lib/loader/lightningcss.d.cts +7 -0
- package/lib/loader/mdx.cjs +1 -1
- package/lib/loader/mdx.d.cts +1 -1
- package/lib/module.config.js +1 -1
- package/lib/plugin/lightningcss-plugin.d.ts +20 -0
- package/lib/plugin/lightningcss-plugin.js +1 -0
- package/lib/polyfills.js +1 -1
- package/lib/prod.js +1 -1
- package/lib/swcrc.js +1 -1
- package/lib/targets.d.ts +3 -0
- package/lib/targets.js +1 -0
- package/package.json +6 -8
- package/typings/global.d.ts +6 -20
- package/lib/loader/css-unicode.cjs +0 -1
- package/lib/loader/css-unicode.d.cts +0 -2
package/lib/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e}from"@moneko/mdx";import{merge as t}from"webpack-merge";import
|
|
1
|
+
import{fileExists as e}from"@moneko/mdx";import{merge as t}from"webpack-merge";import o,{CUSTOMCONFIG as s}from"./paths.js";import{FRAMEWORK as i,PACKAGENAME as n,coreName as r,isDev as a,isLibrary as l,isMobile as m,isSolid as p,jsxImportSource as c,mainDirectory as u}from"./process-env.js";import{isFunction as d,log as h,readConf as f,resolveProgramPath as g}from"./utils.js";let C=["@moneko","neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app",".cache/http/data"],x={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{NODE_ENV:process.env.NODE_ENV},basename:"/",publicPath:"/",rem:{designSize:m?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":g(u)},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:o.webpackCachePath,devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`node_modules/${r}/template/index.html`,favicon:`node_modules/${r}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:{chunks:"all",minSize:1024,minChunks:1,cacheGroups:{CHANGELOG:{test:/CHANGELOG\.md/,priority:-10,name:"CHANGELOG",reuseExistingChunk:!0},prismjs:{test:/(prism\.js|prism\/css\.ts)/,priority:-10,name:"vendors-prismjs",reuseExistingChunk:!0},site:{test:/site/,priority:-10,reuseExistingChunk:!0},marked:{test:/marked/,priority:-10,reuseExistingChunk:!0},"@moneko":{test:/@moneko/,priority:-10,reuseExistingChunk:!0}}},runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:C,js:C,media:C,font:C,wasm:[]},mdx:{jsx:!1,development:a,jsxImportSource:c,providerImportSource:`@moneko/${i}/mdx`},jsxDomExpressions:{},bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:{allowedUris:[],lockfileLocation:`${o.httpCachePath}/http.lock`,cacheLocation:`${o.httpCachePath}/data`,upgrade:!0}};p&&Object.assign(x,{jsxDomExpressions:{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1}}),l&&(x.alias=Object.assign(x.alias,{"@pkg":o.componentsPath,[n]:o.componentsPath}));let k=x,P={},w={};if(e(o.configPath)){let e=(await f(o.configPath,"index")).default;P=d(e)?e(process):e}if(s&&e(o.customConfigPath)){let e=(await f(o.customConfigPath,s)).default;w=d(e)?e(process):e}"tsc"===(k=t(k,P,w)).compiler&&k.minifier&&void 0===k.minifier.type&&(k.minifier.type="terser"),(!1===k.devtool||!1===k.sourceMap)&&(k.sourceMap=!1,k.devtool=!1),k.fixBrowserRouter&&k.htmlPluginOption&&(k.htmlPluginOption.tags||(k.htmlPluginOption.tags=[]),k.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}));export const CONFIG=k;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,CUSTOMCONFIG:s,log:h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const e=require("buffer"),t=require("lightningcss"),r={Declaration:{custom:e=>{if("content"===e.name&&1===e.value.length){let t=e.value[0];if("token"===t.type&&"string"===t.value.type)return[{property:e.name,raw:JSON.stringify(t.value.value.replace(/[\u4e00-\u9faF]/g,e=>`\\${e.charCodeAt(0).toString(16)}`))}]}}}};async function n(n,i){let a=this.async(),{implementation:o,targets:s,visitor:u,rem:c,...f}=this.getOptions();if(o&&"function"!=typeof o.transform){this.cacheable(!1),a(TypeError(`[lightningcss]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof o.transform}`));return}let l=o?.transform??t.transform;try{c&&!r.Length&&(r.Length=function(e){if("px"===e.unit)return{unit:"rem",value:e.value/16}});let{code:t,map:o}=l({filename:this.resourcePath,code:e.Buffer.from(n),targets:s,minify:!0,visitor:{...r,...u},sourceMap:this.sourceMap,inputSourceMap:this.sourceMap&&i?JSON.stringify(i):void 0,...f});this.cacheable(!0),a(null,t.toString(),o&&JSON.parse(o.toString()))}catch(e){this.cacheable(!1),a(e)}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CustomAtRules, type TransformOptions } from 'lightningcss';
|
|
2
|
+
import type { LoaderContext } from 'webpack';
|
|
3
|
+
export interface LightningCssLoaderOption extends Omit<TransformOptions<CustomAtRules>, 'filename' | 'code' | 'inputSourceMap'> {
|
|
4
|
+
rem?: boolean;
|
|
5
|
+
implementation?: typeof import('lightningcss');
|
|
6
|
+
}
|
|
7
|
+
export default function LightningCssLoader(this: LoaderContext<LightningCssLoaderOption>, source: string, prevMap?: Record<string, unknown>): Promise<void>;
|
package/lib/loader/mdx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@moneko/mdx");function t(t){let n=this.async();this.cacheable(!0),(0,e.mdx)({value:t,filepath:this.resourcePath,...this.getOptions()}).then(e=>{n(null,e.code)}).catch(n)}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@moneko/mdx");async function t(t){let n=this.async();this.cacheable(!0),(0,e.mdx)({value:t,filepath:this.resourcePath,...this.getOptions()}).then(e=>{n(null,e.code)}).catch(n)}
|
package/lib/loader/mdx.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type MdxOptions } from '@moneko/mdx';
|
|
2
2
|
import type { LoaderContext } from 'webpack';
|
|
3
|
-
export default function (this: LoaderContext<Omit<MdxOptions, 'value'>>, value: string): void
|
|
3
|
+
export default function (this: LoaderContext<Omit<MdxOptions, 'value'>>, value: string): Promise<void>;
|
package/lib/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"mini-css-extract-plugin";import s from"mini-svg-data-uri";import{CONFIG as t,PUBLICPATH as o}from"./config.js";import
|
|
1
|
+
import e from"mini-css-extract-plugin";import s from"mini-svg-data-uri";import{CONFIG as t,PUBLICPATH as o}from"./config.js";import r from"./modify-vars.js";import a,{CUSTOMCONFIG as i}from"./paths.js";import{FRAMEWORK as l,isDev as n,isLibrary as c,isMicro as d}from"./process-env.js";import m from"./swcrc.js";import{getLightningCssTargets as p}from"./targets.js";import u from"./tsloader.config.js";import{resolveNodeModulesPath as f,resolveProgramPath as y}from"./utils.js";import{comment as x}from"./vm/docs.js";import g from"./vm/generate-doc.js";let $=d?o:"../",v={loader:e.loader,options:{publicPath:"/"!==$?$:"../"}},j={loader:`${a.corePath}/loader/lightningcss.cjs`,options:{sourceMap:!!t.sourceMap,analyzeDependencies:!1,targets:p(),drafts:{nesting:!0,customMedia:!0},errorRecovery:!1,unusedSymbols:[],rem:!!t.rem}};n&&(v="style-loader");let b=[...t.cssModules,`@moneko/${l}`,"neko-ui"].map(f),h=[...["src/styles/variables.less","src/styles/mixins.less","site/styles/variables.less","site/styles/mixins.less"].map(y)],w=["components","example","mock","site","src","server"].map(y);i&&w.push(y(i)),t.overrideResolve&&t.overrideResolve.override&&w.push(t.overrideResolve.override);let _={loader:"css-loader",options:{modules:{auto:e=>{for(let s=0,t=b.length;s<t;s++)if(e&&e?.includes(b[s]))return/(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i.test(e);return/(^(?!.*node_modules))(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i.test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},M=[v,_,j,{loader:"less-loader",options:{sourceMap:!!t.sourceMap,lessOptions:{modifyVars:r,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:h}}].filter(Boolean),B="tsc"===t.compiler,R={loader:B?"ts-loader":"swc-loader",options:B?u:m(n)};function k(e){return w.concat(t.rulesInclude?.[e]?.map(f)||[])}let L=k("media"),O={rules:[c&&n&&{test:/^(?![._]).*(?<!\.test)\.(tsx?)$/,include:t.alias["@pkg"],exclude:[/node_modules/,/(.+)\/__tests__\/(.+)/i],enforce:"pre",loader:`${a.corePath}/loader/ts-doc.cjs`,options:{comment:x,generateDoc:g}},{oneOf:[{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:/\.wasm$/i,type:"webassembly/async",include:k("wasm")},{test:/\.txt$/i,type:"asset/source"},{test:/\.ico$/i,type:"asset/inline",include:L},{test:/\.svg$/i,type:"asset/inline",generator:{dataUrl:e=>s(e.toString())},include:L},{test:/\.(gif|png|jpe?g|webp)$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/images/[name][ext]"},include:L},{test:/\.(webm|mp4|ogv)$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[name][ext]"},include:L},{test:/\.(woff2?|eot|ttf|otf)(\?.*)?$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[name][ext]"},include:k("font")},{test:/\.(sa|sc)ss$/i,use:[v,_,j,{loader:"sass-loader",options:{implementation:await import("sass"),sassOptions:{}}}].filter(Boolean),include:k("css")},{test:/\.less$/i,use:M,include:k("css")},{test:/\.css$/i,use:[v,"css-loader",j].filter(Boolean),include:k("css")},{test:/\.(cj|mj|t|j)s(|x)$/i,use:[...t.prefixJsLoader,R].filter(Boolean),include:k("js")},{test:/\.mdx?$/i,use:[...t.prefixJsLoader,{loader:`${a.corePath}/loader/mdx.cjs`,options:t.mdx}].filter(Boolean),include:w,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/i,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]},...t.moduleRules].filter(e=>"object"==typeof e)};export default O;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Targets } from 'lightningcss';
|
|
2
|
+
import { type Compiler } from 'webpack';
|
|
3
|
+
type Filter = string | RegExp;
|
|
4
|
+
type Implementation = typeof import('lightningcss');
|
|
5
|
+
interface MinifyPluginOpts {
|
|
6
|
+
implementation?: Implementation;
|
|
7
|
+
sourceMap?: boolean;
|
|
8
|
+
test?: RegExp;
|
|
9
|
+
include?: Filter | Filter[];
|
|
10
|
+
exclude?: Filter | Filter[];
|
|
11
|
+
targets?: Targets;
|
|
12
|
+
}
|
|
13
|
+
declare class LightningCssMinifyPlugin {
|
|
14
|
+
private readonly options;
|
|
15
|
+
private readonly transform;
|
|
16
|
+
constructor(opts?: MinifyPluginOpts);
|
|
17
|
+
apply(compiler: Compiler): void;
|
|
18
|
+
private transformAssets;
|
|
19
|
+
}
|
|
20
|
+
export default LightningCssMinifyPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Buffer as s}from"buffer";import{loadFileSync as t}from"@moneko/mdx";import{transform as o}from"lightningcss";import i from"webpack";let{sources:{RawSource:n,SourceMapSource:e},ModuleFilenameHelpers:{matchObject:r}}=i,a="lightning-css-minify",m=/\.css(?:\?.*)?$/i,{name:p,version:f}=JSON.parse(t(`${process.cwd()}/package.json`)||"{}");export default class{constructor(s={}){let{implementation:t,...i}=s;if(t&&"function"!=typeof t.transform)throw TypeError(`[LightningCssMinifyPlugin]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof t.transform}`);this.transform=t?.transform??o,this.options=i}apply(s){let t=JSON.stringify({name:p,version:f,options:this.options});s.hooks.compilation.tap(a,s=>{s.hooks.chunkHash.tap(a,(s,o)=>o.update(t)),s.hooks.processAssets.tapPromise({name:a,stage:s.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,additionalAssets:!0},async()=>await this.transformAssets(s)),s.hooks.statsPrinter.tap(a,s=>{s.hooks.print.for("asset.info.minimized").tap(a,(s,{green:t,formatFlag:o})=>s&&t&&o?t(o("minimized")):void 0)})})}async transformAssets(t){let{options:{devtool:o}}=t.compiler,{include:i,exclude:a,test:p,sourceMap:f=!!(o&&o.includes("source-map")),...c}=this.options,l=t.getAssets().filter(s=>!s.info.minimized&&(p||m).test(s.name)&&r({include:i,exclude:a},s.name));await Promise.all(l.map(async o=>{let i;let{source:r,map:a}=o.source.sourceAndMap(),m=r.toString(),p="string"==typeof r?s.from(r):r,l=this.transform({filename:o.name,code:p,minify:!0,sourceMap:f,...c}),h=l.code.toString();i=f?new e(h,o.name,JSON.parse(l.map.toString()),m,a,!0):new n(h),t.updateAsset(o.name,i,{...o.info,minimized:!0})}))}}
|
package/lib/polyfills.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"core-js-compat";import{getBrowsersTargets as r}from"./targets.js";export default function(){return t({targets:r(),version:"3.34"}).list}
|
package/lib/prod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as e}from"@moneko/mdx";import
|
|
1
|
+
import{removeDirAll as e}from"@moneko/mdx";import o from"mini-css-extract-plugin";import m from"terser-webpack-plugin";import i from"webpack";import{BundleAnalyzerPlugin as n}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import t from"webpackbar";import{clientConfig as p}from"./common.js";import{CONFIG as s}from"./config.js";import{getMinifyOption as l}from"./minify.js";import u from"./paths.js";import a from"./plugin/done.js";import c from"./plugin/lightningcss-plugin.js";import f from"./seo.js";let{optimize:{MinChunkSizePlugin:d}}=i,h=[];s.minifier&&(h.push(new m(l(s.minifier?.type||"swc",s.minifier?.options))),h.push(new c));let k={splitChunks:s.splitChunk,runtimeChunk:s.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:h};i(r(p,{devtool:!1===s.devtool||s.devtool?s.devtool:"cheap-module-source-map",mode:"production",optimization:k,plugins:[new o({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),s.splitChunk&&new d({minChunkSize:1e4}),s.bundleAnalyzer&&new n(s.bundleAnalyzer),s.bar&&new t(s.bar),new a({done:e=>{s.done?.(e),s.seo&&f()}})].filter(Boolean)})).run(e=>{if(e)throw e}),process.on("exit",function(){e(u.cachePath)});
|
package/lib/swcrc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import{CONFIG as o}from"./config.js";import r from"./paths.js";import s from"./polyfills.js";import{isReact as t,isSolid as n,jsxImportSource as c}from"./process-env.js";export const swcMinifyOption={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0};export default((l=!1)=>{let p={module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:"es2017",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:t&&l,development:l,importSource:c},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath,plugins:[["swc-plugin-another-transform-imports",function(e){for(let o=0,r=Object.keys(e),s=r.length;o<s;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{})],n&&["@moneko/jsx-dom-expressions",o.jsxDomExpressions||{}]].filter(Boolean)}},sourceMaps:!0,parseMap:!0};return(o.polyfill&&(p.jsc.target=void 0,p.env={include:s(),mode:"entry",coreJs:"3.
|
|
1
|
+
import{merge as e}from"webpack-merge";import{CONFIG as o}from"./config.js";import r from"./paths.js";import s from"./polyfills.js";import{isReact as t,isSolid as n,jsxImportSource as c}from"./process-env.js";export const swcMinifyOption={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0};export default((l=!1)=>{let p={module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:"es2017",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:t&&l,development:l,importSource:c},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath,plugins:[["swc-plugin-another-transform-imports",function(e){for(let o=0,r=Object.keys(e),s=r.length;o<s;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{})],n&&["@moneko/jsx-dom-expressions",o.jsxDomExpressions||{}]].filter(Boolean)}},sourceMaps:!0,parseMap:!0};return(o.polyfill&&(p.jsc.target=void 0,p.env={include:s(),mode:"entry",coreJs:"3.34"}),o.swcrc)?e(p,"function"==typeof o.swcrc?o.swcrc(l):o.swcrc):p});
|
package/lib/targets.d.ts
ADDED
package/lib/targets.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let r,t;import e from"browserslist";import{browserslistToTargets as s}from"lightningcss";import o from"./paths.js";export function getBrowsersTargets(){return r||(r=e(void 0,{path:o.programPath,env:process.env.NODE_ENV}).filter(r=>!r.endsWith(" TP"))),r}export function getLightningCssTargets(){return t||(t=s(getBrowsersTargets())),t}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.6",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,18 +15,16 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@moneko/mdx": "0.1.18",
|
|
17
17
|
"@swc/core": "1.3.100",
|
|
18
|
-
"@swc/css": "0.0.28",
|
|
19
18
|
"@swc/helpers": "0.5.3",
|
|
20
|
-
"@teamsupercell/typings-for-css-modules-loader": "2.5.2",
|
|
21
19
|
"add-asset-html-webpack-plugin": "6.0.0",
|
|
22
|
-
"core-js": "3.
|
|
23
|
-
"core-js-compat": "3.
|
|
20
|
+
"core-js": "3.34.0",
|
|
21
|
+
"core-js-compat": "3.34.0",
|
|
24
22
|
"cross-env": "7.0.3",
|
|
25
23
|
"css-loader": "6.8.1",
|
|
26
|
-
"
|
|
27
|
-
"html-webpack-plugin": "5.5.3",
|
|
24
|
+
"html-webpack-plugin": "5.5.4",
|
|
28
25
|
"less": "4.2.0",
|
|
29
26
|
"less-loader": "11.1.3",
|
|
27
|
+
"lightningcss": "1.22.1",
|
|
30
28
|
"mini-css-extract-plugin": "2.7.6",
|
|
31
29
|
"mini-svg-data-uri": "1.4.4",
|
|
32
30
|
"sass": "1.69.5",
|
|
@@ -37,7 +35,7 @@
|
|
|
37
35
|
"swc-plugin-another-transform-imports": "0.2.7",
|
|
38
36
|
"ts-import-plugin": "3.0.0",
|
|
39
37
|
"ts-loader": "9.5.1",
|
|
40
|
-
"typescript": "5.3.
|
|
38
|
+
"typescript": "5.3.3",
|
|
41
39
|
"webpack": "5.77.0",
|
|
42
40
|
"webpack-bundle-analyzer": "4.10.1",
|
|
43
41
|
"webpack-cli": "5.1.4",
|
package/typings/global.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { DonePluginOption } from '../lib/plugin/done';
|
|
|
6
6
|
import type { MdxOptions } from '@moneko/mdx';
|
|
7
7
|
import type { Config as SwcConfig, JsMinifyOptions as SwcMinifyOptions } from '@swc/core';
|
|
8
8
|
import type { Options as AssetHtmlOptions } from 'add-asset-html-webpack-plugin';
|
|
9
|
-
import type { CssNanoOptionsExtended } from 'css-minimizer-webpack-plugin';
|
|
10
9
|
import type { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';
|
|
11
10
|
import type { MinifyOptions as TerserMinifyOptions } from 'terser';
|
|
12
11
|
import type { Options } from 'ts-import-plugin';
|
|
@@ -36,7 +35,7 @@ export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
|
|
|
36
35
|
[key: string]: string | null | boolean | number;
|
|
37
36
|
}[];
|
|
38
37
|
};
|
|
39
|
-
export type CssMinify = 'swc' | 'cssnano';
|
|
38
|
+
export type CssMinify = 'swc' | 'cssnano' | 'lightningcss';
|
|
40
39
|
export type DevtoolOption =
|
|
41
40
|
| 'eval'
|
|
42
41
|
| 'eval-cheap-source-map'
|
|
@@ -110,24 +109,11 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
110
109
|
/** 压缩配置 */
|
|
111
110
|
minifier:
|
|
112
111
|
| {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
type?: MinifierType;
|
|
119
|
-
options?: SwcMinifyOptions | TerserMinifyOptions;
|
|
120
|
-
}
|
|
121
|
-
| false;
|
|
122
|
-
css?:
|
|
123
|
-
| {
|
|
124
|
-
/**
|
|
125
|
-
* @default 'swc'
|
|
126
|
-
*/
|
|
127
|
-
type?: CssMinify;
|
|
128
|
-
options?: CssNanoOptionsExtended;
|
|
129
|
-
}
|
|
130
|
-
| false;
|
|
112
|
+
/**
|
|
113
|
+
* @default 'swc'
|
|
114
|
+
*/
|
|
115
|
+
type?: MinifierType;
|
|
116
|
+
options?: SwcMinifyOptions | TerserMinifyOptions;
|
|
131
117
|
}
|
|
132
118
|
| false;
|
|
133
119
|
/** 环境变量, 可通过 process.env 获取 */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=/(?<!-)content\s*:\s*([^;\\}]+)/g,t=/[\u4e00-\u9faF]+/g;function r(r){return this.cacheable(!0),r.replace(e,function(e){return e.replace(t,function(e){return`\\${e.charCodeAt(0).toString(16)}`})})}
|