@moneko/core 2.0.53 → 2.0.55

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/build/common.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _customConf_minifier,_fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_readline=_interopRequireDefault(require("readline")),_chalk=_interopRequireDefault(require("chalk")),_webpackMerge=require("webpack-merge"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processEnv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processEnv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{options:{},css:"cssnano"},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===_processEnv.APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:_processEnv.PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+_processEnv.pkgName+"/template/index.html",favicon:"./node_modules/"+_processEnv.pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==_processEnv.APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}},log=function(e){_readline.default.cursorTo(process.stdout,0),process.stdout.write(e)},customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/index.ts"),_fs.default.accessSync(configPath,_fs.default.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval((0,_utils.tfc)(configPath)).default;normalConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}if(_processEnv.CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/"+_processEnv.CUSTOMCONFIG+".ts"),_fs.default.accessSync(customConfigPath,_fs.default.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval((0,_utils.tfc)(customConfigPath)).default;envConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}}customConf=(0,_webpackMerge.merge)(customConf,normalConf,envConf),(null==customConf?void 0:null==(_customConf_minifier=customConf.minifier)?void 0:_customConf_minifier.type)||(customConf.minifier.type="swc"===customConf.compiler?"swc":"terser"),!1===customConf.devtool&&(customConf.sourceMap=!1),!1===customConf.sourceMap&&(customConf.devtool=!1),customConf.fixBrowserRouter&&(customConf.htmlPluginOption.tags||(customConf.htmlPluginOption.tags=[]),customConf.htmlPluginOption.tags.push({textContent:"\n (function(l) {\n if (l.search[1] === '/' ) {\n var decoded = l.search.slice(1).split('&').map(function(s) { \n return s.replace(/~and~/g, '&')\n }).join('?');\n window.history.replaceState(null, null,\n l.pathname.slice(0, -1) + decoded + l.hash\n );\n }\n }(window.location))\n "}));var CONFIG=customConf,PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
1
+ "use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_readline=_interopRequireDefault(require("readline")),_chalk=_interopRequireDefault(require("chalk")),_webpackMerge=require("webpack-merge"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processEnv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processEnv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",emotion:{},bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===_processEnv.APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:_processEnv.PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+_processEnv.pkgName+"/template/index.html",favicon:"./node_modules/"+_processEnv.pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==_processEnv.APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}},log=function(e){_readline.default.cursorTo(process.stdout,0),process.stdout.write(e)},customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/index.ts"),_fs.default.accessSync(configPath,_fs.default.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval((0,_utils.tfc)(configPath)).default;normalConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}if(_processEnv.CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/"+_processEnv.CUSTOMCONFIG+".ts"),_fs.default.accessSync(customConfigPath,_fs.default.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval((0,_utils.tfc)(customConfigPath)).default;envConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}}customConf=(0,_webpackMerge.merge)(customConf,normalConf,envConf),!1===customConf.devtool&&(customConf.sourceMap=!1),!1===customConf.sourceMap&&(customConf.devtool=!1),customConf.fixBrowserRouter&&(customConf.htmlPluginOption.tags||(customConf.htmlPluginOption.tags=[]),customConf.htmlPluginOption.tags.push({textContent:"\n (function(l) {\n if (l.search[1] === '/' ) {\n var decoded = l.search.slice(1).split('&').map(function(s) { \n return s.replace(/~and~/g, '&')\n }).join('?');\n window.history.replaceState(null, null,\n l.pathname.slice(0, -1) + decoded + l.hash\n );\n }\n }(window.location))\n "}));var CONFIG=customConf,PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
package/build/swcrc.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),t=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),o={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={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},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":t.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,t=Object.keys(e),o=t.length;r<o;r++)e[t[r]].transform=t[r]+"/"+e[t[r]].transform,e[t[r]].style&&(e[t[r]].style=t[r]+"/"+e[t[r]].style);return e}(r.CONFIG.importOnDemand||{})]]}},sourceMaps:!0},!n&&o);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var o in r)Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),o=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),t={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={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},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":o.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,o=Object.keys(e),t=o.length;r<t;r++)e[o[r]].transform=o[r]+"/"+e[o[r]].transform,e[o[r]].style&&(e[o[r]].style=o[r]+"/"+e[o[r]].style);return e}(r.CONFIG.importOnDemand||{})],["@swc/plugin-emotion",r.CONFIG.emotion]]}},sourceMaps:!0},!n&&t);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return f}});var e=function(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(n);if(r&&r.has(e))return r.get(e);var i={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=t?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(i,u,o):i[u]=e[u]}return i.default=e,r&&r.set(e,i),i}(require("css-minimizer-webpack-plugin")),n=c(require("mini-css-extract-plugin")),r=c(require("terser-webpack-plugin")),i=require("webpack"),t=require("webpack-bundle-analyzer"),u=require("webpack-merge"),o=require("./common"),l=require("./minify"),a=c(require("./webpack.common"));function c(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:n})(e)}var p={splitChunks:o.CONFIG.splitChunk,runtimeChunk:o.CONFIG.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:[new r.default((0,l.getMinifyOption)(o.CONFIG.minifier.type||"swc",o.CONFIG.minifier.options)),new e.default({minify:"parcelCss"===o.CONFIG.minifier.css?e.parcelCssMinify:e.cssnanoMinify})]},m=!1;o.CONFIG.cacheDirectory&&(m={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.CONFIG.cacheDirectory});var f=(0,u.merge)(a.default,{devtool:!1===o.CONFIG.devtool||o.CONFIG.devtool?o.CONFIG.devtool:"cheap-module-source-map",mode:"production",cache:m,optimization:p,plugins:[new n.default({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),o.CONFIG.bundleAnalyzer&&new t.BundleAnalyzerPlugin(o.CONFIG.bundleAnalyzer),o.CONFIG.splitChunk&&new i.optimize.MinChunkSizePlugin({minChunkSize:1e4})].filter(Boolean)});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var e,n,i,r,t=function(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=d(n);if(i&&i.has(e))return i.get(e);var r={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=t?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,i&&i.set(e,r),r}(require("css-minimizer-webpack-plugin")),u=f(require("mini-css-extract-plugin")),o=f(require("terser-webpack-plugin")),l=require("webpack"),c=require("webpack-bundle-analyzer"),a=require("webpack-merge"),s=require("./common"),p=require("./minify"),m=f(require("./webpack.common"));function f(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(d=function(e){return e?i:n})(e)}var y="swc"===s.CONFIG.compiler?"swc":"terser",O="swc"===s.CONFIG.compiler?"swc":"cssnano",C={swc:t.swcMinify,cssnano:t.cssnanoMinify},w={splitChunks:s.CONFIG.splitChunk,runtimeChunk:s.CONFIG.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:[new o.default((0,p.getMinifyOption)((null==(e=s.CONFIG.minifier.js)?void 0:e.type)||y,null==(n=s.CONFIG.minifier.js)?void 0:n.options)),new t.default({minify:C[(null==(i=s.CONFIG.minifier.css)?void 0:i.type)||O],minimizerOptions:null==(r=s.CONFIG.minifier.css)?void 0:r.options})]},k=!1;s.CONFIG.cacheDirectory&&(k={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.CONFIG.cacheDirectory});var b=(0,a.merge)(m.default,{devtool:!1===s.CONFIG.devtool||s.CONFIG.devtool?s.CONFIG.devtool:"cheap-module-source-map",mode:"production",cache:k,optimization:w,plugins:[new u.default({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),s.CONFIG.bundleAnalyzer&&new c.BundleAnalyzerPlugin(s.CONFIG.bundleAnalyzer),s.CONFIG.splitChunk&&new l.optimize.MinChunkSizePlugin({minChunkSize:1e4})].filter(Boolean)});
@@ -26,7 +26,7 @@ body {
26
26
 
27
27
  input,
28
28
  textarea {
29
- caret-color: var(--primary-color-bg);;
29
+ caret-color: var(--primary-bg);;
30
30
  }
31
31
 
32
32
  h1 {
@@ -138,7 +138,7 @@ button:-moz-focusring,
138
138
  [type='button']:-moz-focusring,
139
139
  [type='reset']:-moz-focusring,
140
140
  [type='submit']:-moz-focusring {
141
- outline: 1px dotted var(--primary-color-outline);
141
+ outline: 1px dotted var(--primary-outline);
142
142
  }
143
143
 
144
144
  fieldset {
@@ -215,15 +215,15 @@ template {
215
215
  }
216
216
 
217
217
  :hover::-webkit-scrollbar-thumb {
218
- background-color: var(--primary-color-bg);
218
+ background-color: var(--primary-bg);
219
219
  }
220
220
 
221
221
  ::-webkit-scrollbar-thumb:hover {
222
- background-color: var(--primary-color-hover);
222
+ background-color: var(--primary-hover);
223
223
  }
224
224
 
225
225
  ::-webkit-scrollbar-thumb:active {
226
- background-color: var(--primary-color-active);
226
+ background-color: var(--primary-active);
227
227
  }
228
228
 
229
229
  ::-webkit-scrollbar-button {
@@ -12,7 +12,7 @@
12
12
  --text-color: rgb(0 0 0 / 65%);
13
13
  --text-secondary: #4e4e4e;
14
14
  --text-heading: #1b1b1b;
15
- --text-selection-bg: var(--primary-color-bg);
15
+ --text-selection-bg: var(--primary-bg);
16
16
  --text-shadow-color: rgb(0 0 0 / 10%);
17
17
  --box-shadow-base: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%),
18
18
  0 9px 28px 8px rgb(0 0 0 / 5%);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "2.0.53",
3
+ "version": "2.0.55",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -18,63 +18,64 @@
18
18
  "@emotion/css": "11.10.6",
19
19
  "@mapbox/rehype-prism": "0.8.0",
20
20
  "@mdx-js/loader": "2.3.0",
21
- "@moneko/common": "1.0.32",
22
- "@parcel/css": "1.14.0",
21
+ "@moneko/common": "1.0.33",
23
22
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
24
23
  "@soda/friendly-errors-webpack-plugin": "1.8.1",
25
24
  "@swc/core": "1.3.37",
26
- "@swc/helpers": "0.4.14",
25
+ "@swc/css": "0.0.20",
26
+ "@swc/helpers": "0.5.0",
27
+ "@swc/plugin-emotion": "2.5.46",
27
28
  "add-asset-html-webpack-plugin": "5.0.2",
28
- "core-js": "3.29.1",
29
+ "core-js": "3.30.1",
29
30
  "cross-env": "7.0.3",
30
31
  "css-loader": "6.7.3",
31
- "css-minimizer-webpack-plugin": "4.2.2",
32
+ "css-minimizer-webpack-plugin": "5.0.0",
32
33
  "css-unicode-loader": "1.0.3",
33
34
  "external-remotes-plugin": "1.0.0",
34
- "html-webpack-plugin": "5.5.0",
35
+ "html-webpack-plugin": "5.5.1",
35
36
  "less": "4.1.3",
36
37
  "less-loader": "11.1.0",
37
- "mini-css-extract-plugin": "2.7.3",
38
+ "mini-css-extract-plugin": "2.7.5",
38
39
  "mini-svg-data-uri": "1.4.4",
39
40
  "path-to-regexp": "6.2.1",
40
41
  "portfinder": "1.0.32",
41
- "react-activation": "0.12.2",
42
+ "react-activation": "0.12.4",
42
43
  "react-refresh": "0.14.0",
43
- "react-refresh-typescript": "2.0.8",
44
- "react-router": "6.9.0",
45
- "react-router-dom": "6.9.0",
44
+ "react-refresh-typescript": "2.0.9",
45
+ "react-router": "6.10.0",
46
+ "react-router-dom": "6.10.0",
46
47
  "rehype-accessible-emojis": "0.3.2",
47
48
  "rehype-figure": "1.0.1",
48
- "shared-store-object": "1.0.4",
49
- "style-loader": "3.3.1",
49
+ "shared-store-object": "1.0.6",
50
+ "style-loader": "3.3.2",
50
51
  "style-resources-loader": "1.5.0",
51
52
  "swc-loader": "0.2.3",
52
53
  "swc-plugin-another-transform-imports": "0.2.1",
53
- "ts-import-plugin": "2.0.0",
54
+ "ts-import-plugin": "3.0.0",
54
55
  "ts-loader": "9.4.2",
55
- "typescript": "5.0.2",
56
+ "typescript": "5.0.4",
56
57
  "webpack": "5.76.1",
57
58
  "webpack-bundle-analyzer": "4.8.0",
58
59
  "webpack-cli": "5.0.1",
59
60
  "webpack-dev-server": "4.11.1",
60
61
  "webpack-merge": "5.8.0",
61
62
  "webpackbar": "5.0.2",
62
- "xml2js": "0.4.23"
63
+ "xml2js": "0.5.0"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@swc/cli": "0.1.62",
66
67
  "@types/mini-css-extract-plugin": "^2.5.1",
67
- "@types/react": "^18.0.28",
68
+ "@types/react": "^18.0.35",
68
69
  "@types/react-dom": "^18.0.11",
69
70
  "@types/react-router-dom": "^5.3.3",
70
- "@types/shelljs": "^0.8.11",
71
+ "@types/shelljs": "^0.8.12",
71
72
  "@types/webpack-bundle-analyzer": "^4.6.0",
72
73
  "@types/webpack-env": "^1.18.0",
73
- "antd": "5.3.1",
74
- "eslint-config-neko": "^1.0.20",
74
+ "antd": "5.4.2",
75
+ "eslint-config-neko": "^1.0.22",
75
76
  "react": "^18.2.0",
76
77
  "shelljs": "^0.8.5",
77
- "stylelint-config-moneko": "^1.0.9"
78
+ "stylelint-config-moneko": "^1.0.13"
78
79
  },
79
80
  "files": [
80
81
  "lib",
@@ -3,6 +3,7 @@ import { Options as AssetHtmlOptions } from 'add-asset-html-webpack-plugin';
3
3
  import { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';
4
4
  import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
5
5
  import type { JsMinifyOptions, Config as SwcConfig } from '@swc/core';
6
+ import type { CssNanoOptionsExtended } from 'css-minimizer-webpack-plugin';
6
7
  import type { MinifyOptions } from 'terser';
7
8
  import type { Options } from 'ts-import-plugin';
8
9
  import type { RuleSetRule, WebpackPluginInstance, Configuration } from 'webpack';
@@ -30,6 +31,8 @@ export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
30
31
  [key: string]: string | null | boolean | number;
31
32
  }[];
32
33
  };
34
+ export type CssMinify = 'swc' | 'cssnano';
35
+
33
36
  export interface Theme {
34
37
  primaryColor?: string;
35
38
  infoColor?: string;
@@ -47,6 +50,40 @@ export declare type ConfigType<T = 'tsc'> = {
47
50
  * @default 'swc'
48
51
  */
49
52
  compiler: 'tsc' | 'swc';
53
+ emotion: {
54
+ /** sourceMap: 默认开启, 当构建为生产时将禁用
55
+ * @default true
56
+ */
57
+ sourceMap?: boolean;
58
+ /**
59
+ * @description
60
+ * 自动将标签属性添加到样式中,以便由css或样式生成的类名包括结果分配到的变量的名称。
61
+ * @default 'dev-only'
62
+ */
63
+ autoLabel?: 'never' | 'dev-only' | 'always';
64
+ /** 定义类名的格式
65
+ * @alias [local]: 样式表达式的结果被分配到的变量的名称。
66
+ * @alias [filename]: 样式表达式所在的文件名称(无扩展名)。
67
+ * @alias [dirname]: 包含样式表达式所在文件的目录的名称。
68
+ * @default '[local]'
69
+ * @description
70
+ * 此选项仅在autoLabel设置为 `dev-only` 或 `always` 时有效。
71
+ * 它允许您定义结果标签的格式。
72
+ * 格式通过字符串定义,其中变量部分用方括号括起来[]。
73
+ * 例如labelFormat:"my-classname--[local]",其中[local]将替换为结果分配给的变量的名称。
74
+ */
75
+ labelFormat?: string;
76
+ /**
77
+ * @description
78
+ * 此选项假设您正在使用某些东西使 `@emotion/react` 的 jsx 函数适用于所有 jsx。如果您不这样做,并且不希望发生此类优化,请禁用此选项。
79
+ * @default true
80
+ */
81
+ cssPropOptimization?: boolean;
82
+ /**
83
+ * @default true
84
+ */
85
+ importMap?: boolean;
86
+ };
50
87
  /** swc 配置项,仅当编译器为 swc 时有效 */
51
88
  swcrc?: SwcConfig | ((isDev: boolean) => SwcConfig);
52
89
  /**
@@ -65,15 +102,20 @@ export declare type ConfigType<T = 'tsc'> = {
65
102
  entry?: Record<string, string>;
66
103
  /** 压缩配置 */
67
104
  minifier: {
68
- /**
69
- * @default 'swc'
70
- */
71
- type?: MinifierType;
72
- options?: SwcOptions | TerserOptions;
73
- /**
74
- * @default 'parcelCss'
75
- */
76
- css?: 'cssnano' | 'parcelCss';
105
+ js?: {
106
+ /**
107
+ * @default 'swc'
108
+ */
109
+ type?: MinifierType;
110
+ options?: SwcOptions | TerserOptions;
111
+ };
112
+ css?: {
113
+ /**
114
+ * @default 'swc'
115
+ */
116
+ type?: CssMinify;
117
+ options?: CssNanoOptionsExtended;
118
+ };
77
119
  };
78
120
  /** 环境变量, 可通过 process.env 获取 */
79
121
  // eslint-disable-next-line @typescript-eslint/no-explicit-any