@modern-js/uni-builder 2.44.0 → 2.46.0
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/compiled/babel-plugin-lodash/index.d.ts +1 -0
- package/compiled/babel-plugin-lodash/index.js +1 -0
- package/compiled/babel-plugin-lodash/license +44 -0
- package/compiled/babel-plugin-lodash/package.json +1 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +13 -0
- package/dist/rspack/index.d.ts +3 -13
- package/dist/rspack/index.js +11 -1
- package/dist/rspack/plugins/babel-post.d.ts +5 -0
- package/dist/rspack/plugins/babel-post.js +55 -0
- package/dist/shared/compatLegacyPlugin.d.ts +5 -0
- package/dist/shared/compatLegacyPlugin.js +82 -0
- package/dist/shared/devServer.d.ts +6 -3
- package/dist/shared/devServer.js +5 -1
- package/dist/shared/parseCommonConfig.d.ts +2 -2
- package/dist/shared/parseCommonConfig.js +48 -18
- package/dist/shared/plugins/frameworkConfig.js +3 -0
- package/dist/shared/plugins/splitChunk.js +2 -0
- package/dist/types.d.ts +67 -7
- package/dist/webpack/index.d.ts +4 -8
- package/dist/webpack/index.js +9 -0
- package/dist/webpack/plugins/babel.js +5 -0
- package/package.json +26 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={443:(e,t)=>{"use strict";t.__esModule=true;t["default"]=MapCtor;function MapCtor(e){return Object.setPrototypeOf(new Map(e),Object.getPrototypeOf(this))}MapCtor.prototype=Map.prototype;e.exports=t["default"]},390:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(443));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var i={};var s=function(e){_inheritsLoose(MapCache,e);function MapCache(){return e.apply(this,arguments)||this}var t=MapCache.prototype;t.clear=function clear(){e.prototype.clear.call(this);return this};t.findKey=function findKey(e){var t;try{this.forEach((function(r,a,s){if(e(r,a,s)){t=a;throw i}}))}catch(e){if(e!==i){throw e}}return t};return MapCache}(a.default);t["default"]=s;e.exports=t["default"]},537:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(848));var i=_interopRequireDefault(r(30));var s=_interopRequireDefault(r(823));var o=_interopRequireDefault(r(320));var n=_interopRequireDefault(r(765));var u=_interopRequireDefault(r(865));var l=_interopRequireDefault(r(147));var f=_interopRequireDefault(r(205));var d=_interopRequireDefault(r(390));var p=_interopRequireDefault(r(188));var c=r(906);var h=_interopRequireDefault(r(17));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var m=function(e){_inheritsLoose(ModuleCache,e);function ModuleCache(t){var r;r=e.call(this)||this;t=(0,u.default)(t);if(!t){return _assertThisInitialized(r)}var a=h.default.join(t,"package.json");var p=l.default.existsSync(a)&&require(a).main||"index.js";var m=(0,c.normalizePath)(h.default.dirname(h.default.resolve(t,p)));var _=(0,n.default)(f.default.sync(h.default.join(t,"**/"),{ignore:h.default.join(t,"node_modules/**/")}),(function(e){return(0,o.default)(e,m)}),["desc"]);(0,s.default)(_,(function(e){var a=h.default.relative(t,e);var s=f.default.sync(h.default.join(e,"*.js"));var o=(0,i.default)(s,(function(e){var t=h.default.basename(e,".js");return[t.toLowerCase(),t]}));r.set(a,new d.default(o))}));return r}ModuleCache.resolve=function resolve(e,t){if(t===void 0){t=process.cwd()}try{var r=h.default.dirname(p.default._resolveFilename(e,(0,a.default)(new p.default,{paths:p.default._nodeModulePaths(t)}))).split(h.default.sep);var i=r.length;while(i--){var s=r.slice(0,i+1);var o=s.join("/");var n=h.default.join(o,"package.json");if(i&&r[i-1]=="node_modules"||l.default.existsSync(n)&&require(n).name==e){return o}}return r.join("/")}catch(e){}return""};return ModuleCache}(d.default);t["default"]=m;e.exports=t["default"]},715:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(73));var i=_interopRequireDefault(r(865));var s=_interopRequireDefault(r(72));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=/^lodash(?:-compat|-es)?$/;var n=function Package(e){e=(0,i.default)(e);var t=(0,s.default)(e);this.base=e.replace(new RegExp(t+"/?"),"");this.id=t;this.isLodash=(0,a.default)(o.test(this.id));this.path=e};t["default"]=n;e.exports=t["default"]},498:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(823));var i=_interopRequireDefault(r(390));var s=r(906);var o=_interopRequireDefault(r(715));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}var n=function(e){_inheritsLoose(Store,e);function Store(t){var r;r=e.call(this)||this;(0,a.default)(t,(function(e){return r.set(e)}));return r}var t=Store.prototype;t.get=function get(t){return e.prototype.get.call(this,(0,s.normalizePath)(t))};t.set=function set(t,r){if(r===void 0){r=new o.default((0,s.normalizePath)(t))}return e.prototype.set.call(this,(0,s.normalizePath)(t),r)};return Store}(i.default);t["default"]=n;e.exports=t["default"]},176:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=config;var a=_interopRequireDefault(r(779));var i=_interopRequireDefault(r(823));var s=_interopRequireDefault(r(390));var o=_interopRequireDefault(r(537));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var n=["lodash","lodash-es","lodash-compat"];var u;var l=[];var f=new s.default;function config(e){var t=e===void 0?{}:e,r=t.cwd,s=r===void 0?process.cwd():r,d=t.id,p=d===void 0?n:d;if(u!==s){u=s;f.clear()}(0,i.default)((0,a.default)(p),(function(e){if(!f.get(e)){var t=o.default.resolve(e,s);if(t){l.push(e);f.set(e,new o.default(t))}}}));return{ids:l,modules:f}}e.exports=t["default"]},445:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(319));var i=r(408);var s=_interopRequireDefault(r(698));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function resolvePath(e,t,r){var a=e.base,i=e.id;var o=t.toLowerCase();var n=s.default.modules.get(i);if(!n.get(a).has(o)){a=a?"":n.findKey((function(e){return e.has(o)}));if(!a){throw r.buildCodeFrameError([`The '${i}' method \`${t}\` is not a known module.`,"Please report bugs to https://github.com/lodash/babel-plugin-lodash/issues."].join("\n"))}}return i+"/"+(a?a+"/":"")+n.get(a).get(o)}function importModule(e,t,r){return(0,i.addDefault)(r,resolvePath(e,t,r),{nameHint:t})}var o=(0,a.default)(importModule,(function(e,t){return(e.path+"/"+t).toLowerCase()}));t["default"]=o;e.exports=t["default"]},380:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=lodash;var a=_interopRequireDefault(r(80));var i=_interopRequireDefault(r(163));var s=_interopRequireDefault(r(823));var o=_interopRequireDefault(r(848));var n=r(638);var u=_interopRequireDefault(r(176));var l=_interopRequireDefault(r(445));var f=_interopRequireDefault(r(698));var d=_interopRequireDefault(r(498));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var p=["Lodash chain sequences are not supported by babel-plugin-lodash.","Consider substituting chain sequences with composition patterns.","See https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba"].join("\n");function lodash(e){var t=e.types;var r={PLACEHOLDER:t.identifier("placeholder"),UNDEFINED:t.identifier("undefined")};var c=new d.default;function getCallee(e){var r=e.parentPath;while(!r.isStatement()){if(r.isCallExpression()){var a=r.node.callee;while(t.isCallExpression(a)){a=a.callee}return a}r=r.parentPath}}var h={Program(e,a){var d=(0,o.default)(f.default,(0,u.default)(a.opts)),h=d.ids;var m=e.hub.file;l.default.cache.clear();c.clear();(0,s.default)(h,(function(e){c.set(e);f.default.modules.get(e).forEach((function(t,r){c.set(e+"/"+r)}))}));var _=[];var v=false;for(var b=m.ast.program.body,y=Array.isArray(b),g=0,b=y?b:b[Symbol.iterator]();;){var D;if(y){if(g>=b.length)break;D=b[g++]}else{g=b.next();if(g.done)break;D=g.value}var q=D;if((0,n.isImportDeclaration)(q)||(0,n.isExportDeclaration)(q)){v=true;break}}if(v){m.path.traverse({ImportDeclaration:{exit(e){var t=e.node;var r=[];var a=[];_.push({source:t.source.value,imported:r,specifiers:a});for(var i=e.get("specifiers"),s=Array.isArray(i),o=0,i=s?i:i[Symbol.iterator]();;){var n;if(s){if(o>=i.length)break;n=i[o++]}else{o=i.next();if(o.done)break;n=o.value}var u=n;var l=u.node.local.name;if(u.isImportDefaultSpecifier()){r.push("default");a.push({kind:"named",imported:"default",local:l})}if(u.isImportSpecifier()){var f=u.node.imported.name;r.push(f);a.push({kind:"named",imported:f,local:l})}if(u.isImportNamespaceSpecifier()){r.push("*");a.push({kind:"namespace",local:l})}}}}})}(0,s.default)(_,(function(e){var a=c.get(e.source);if(!a){return}var o=a.isLodash();var n=(0,i.default)(e.specifiers,(function(e){return e.imported==="default"}));(0,s.default)(n,(function(e){var i=e.imported,n=e.local;var u=m.scope.getBinding(n);var f=u.path.parent.importKind,d=f===void 0?"value":f;if(d!="value"){return}var c=o&&i==="chain";(0,s.default)(u.referencePaths,(function(e){var s=e.node,u=e.parentPath;var f=s.type;if(i&&i!=="default"){if(c&&e.parentPath.isCallExpression()){throw e.buildCodeFrameError(p)}var d=(0,l.default)(a,i,e),h=d.name;e.replaceWith({type:f,name:h})}else if(u.isMemberExpression()){var m=e.parent.property.name;if(o&&m==="chain"&&u.parentPath.isCallExpression()){throw e.buildCodeFrameError(p)}var _=(0,l.default)(a,m,e),v=_.name;u.replaceWith({type:f,name:v})}else if(o){var b=getCallee(e);if(b&&b.name===n){throw e.buildCodeFrameError(p)}e.replaceWith(b?t.memberExpression(b,r.PLACEHOLDER):r.UNDEFINED)}}))}))}))},ImportDeclaration(e){if(c.get(e.node.source.value)){e.remove()}},ExportNamedDeclaration(e){var t=e.node;var r=(0,a.default)(t,"source.value");var i=c.get(r);if(!i){return}t.source=null;(0,s.default)(t.specifiers,(function(t){t.local=(0,l.default)(i,t.local.name,e)}))}};return{visitor:h}}e.exports=t["default"]},698:(e,t,r)=>{"use strict";t.__esModule=true;t["default"]=void 0;var a=_interopRequireDefault(r(176));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=(0,a.default)();t["default"]=i;e.exports=t["default"]},906:(e,t,r)=>{"use strict";t.__esModule=true;t.normalizePath=normalizePath;var a=_interopRequireDefault(r(865));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function normalizePath(e){return(0,a.default)(e).replace(/\\/g,"/")}},72:e=>{var t=/^(?:(@[^/]+)[/]+)([^/]+)[/]?/;var r=/^([^/]+)[/]?/;e.exports=extract.bind(null,false);e.exports.base=extract.bind(null,true);function extract(e,a){if(/^@/.test(a)){var i=t.exec(a);if(!i||!i[1]||!i[2])return null;if(e)return i[2]||null;return[i[1],i[2]].join("/")}else{var i=r.exec(a);if(!i)return null;return i[1]||null}}},638:e=>{"use strict";e.exports=require("@babel/types")},205:e=>{"use strict";e.exports=require("glob")},491:e=>{"use strict";e.exports=require("assert")},147:e=>{"use strict";e.exports=require("fs")},848:e=>{"use strict";e.exports=require("lodash/assign")},779:e=>{"use strict";e.exports=require("lodash/castArray")},73:e=>{"use strict";e.exports=require("lodash/constant")},823:e=>{"use strict";e.exports=require("lodash/each")},80:e=>{"use strict";e.exports=require("lodash/get")},30:e=>{"use strict";e.exports=require("lodash/map")},319:e=>{"use strict";e.exports=require("lodash/memoize")},765:e=>{"use strict";e.exports=require("lodash/orderBy")},163:e=>{"use strict";e.exports=require("lodash/sortBy")},320:e=>{"use strict";e.exports=require("lodash/startsWith")},865:e=>{"use strict";e.exports=require("lodash/toString")},188:e=>{"use strict";e.exports=require("module")},17:e=>{"use strict";e.exports=require("path")},79:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=r(491);var i=r(638);const{callExpression:s,cloneNode:o,expressionStatement:n,identifier:u,importDeclaration:l,importDefaultSpecifier:f,importNamespaceSpecifier:d,importSpecifier:p,memberExpression:c,stringLiteral:h,variableDeclaration:m,variableDeclarator:_}=i;class ImportBuilder{constructor(e,t,r){this._statements=[];this._resultName=null;this._importedSource=void 0;this._scope=t;this._hub=r;this._importedSource=e}done(){return{statements:this._statements,resultName:this._resultName}}import(){this._statements.push(l([],h(this._importedSource)));return this}require(){this._statements.push(n(s(u("require"),[h(this._importedSource)])));return this}namespace(e="namespace"){const t=this._scope.generateUidIdentifier(e);const r=this._statements[this._statements.length-1];a(r.type==="ImportDeclaration");a(r.specifiers.length===0);r.specifiers=[d(t)];this._resultName=o(t);return this}default(e){const t=this._scope.generateUidIdentifier(e);const r=this._statements[this._statements.length-1];a(r.type==="ImportDeclaration");a(r.specifiers.length===0);r.specifiers=[f(t)];this._resultName=o(t);return this}named(e,t){if(t==="default")return this.default(e);const r=this._scope.generateUidIdentifier(e);const i=this._statements[this._statements.length-1];a(i.type==="ImportDeclaration");a(i.specifiers.length===0);i.specifiers=[p(r,u(t))];this._resultName=o(r);return this}var(e){const t=this._scope.generateUidIdentifier(e);let r=this._statements[this._statements.length-1];if(r.type!=="ExpressionStatement"){a(this._resultName);r=n(this._resultName);this._statements.push(r)}this._statements[this._statements.length-1]=m("var",[_(t,r.expression)]);this._resultName=o(t);return this}defaultInterop(){return this._interop(this._hub.addHelper("interopRequireDefault"))}wildcardInterop(){return this._interop(this._hub.addHelper("interopRequireWildcard"))}_interop(e){const t=this._statements[this._statements.length-1];if(t.type==="ExpressionStatement"){t.expression=s(e,[t.expression])}else if(t.type==="VariableDeclaration"){a(t.declarations.length===1);t.declarations[0].init=s(e,[t.declarations[0].init])}else{a.fail("Unexpected type.")}return this}prop(e){const t=this._statements[this._statements.length-1];if(t.type==="ExpressionStatement"){t.expression=c(t.expression,u(e))}else if(t.type==="VariableDeclaration"){a(t.declarations.length===1);t.declarations[0].init=c(t.declarations[0].init,u(e))}else{a.fail("Unexpected type:"+t.type)}return this}read(e){this._resultName=c(this._resultName,u(e))}}t["default"]=ImportBuilder},378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=r(491);var i=r(638);var s=r(79);var o=r(898);const{numericLiteral:n,sequenceExpression:u}=i;class ImportInjector{constructor(e,t,r){this._defaultOpts={importedSource:null,importedType:"commonjs",importedInterop:"babel",importingInterop:"babel",ensureLiveReference:false,ensureNoContext:false,importPosition:"before"};const a=e.find((e=>e.isProgram()));this._programPath=a;this._programScope=a.scope;this._hub=a.hub;this._defaultOpts=this._applyDefaults(t,r,true)}addDefault(e,t){return this.addNamed("default",e,t)}addNamed(e,t,r){a(typeof e==="string");return this._generateImport(this._applyDefaults(t,r),e)}addNamespace(e,t){return this._generateImport(this._applyDefaults(e,t),null)}addSideEffect(e,t){return this._generateImport(this._applyDefaults(e,t),void 0)}_applyDefaults(e,t,r=false){let i;if(typeof e==="string"){i=Object.assign({},this._defaultOpts,{importedSource:e},t)}else{a(!t,"Unexpected secondary arguments.");i=Object.assign({},this._defaultOpts,e)}if(!r&&t){if(t.nameHint!==undefined)i.nameHint=t.nameHint;if(t.blockHoist!==undefined)i.blockHoist=t.blockHoist}return i}_generateImport(e,t){const r=t==="default";const a=!!t&&!r;const i=t===null;const{importedSource:l,importedType:f,importedInterop:d,importingInterop:p,ensureLiveReference:c,ensureNoContext:h,nameHint:m,importPosition:_,blockHoist:v}=e;let b=m||t;const y=(0,o.default)(this._programPath);const g=y&&p==="node";const D=y&&p==="babel";if(_==="after"&&!y){throw new Error(`"importPosition": "after" is only supported in modules`)}const q=new s.default(l,this._programScope,this._hub);if(f==="es6"){if(!g&&!D){throw new Error("Cannot import an ES6 module from CommonJS")}q.import();if(i){q.namespace(m||l)}else if(r||a){q.named(b,t)}}else if(f!=="commonjs"){throw new Error(`Unexpected interopType "${f}"`)}else if(d==="babel"){if(g){b=b!=="default"?b:l;const e=`${l}$es6Default`;q.import();if(i){q.default(e).var(b||l).wildcardInterop()}else if(r){if(c){q.default(e).var(b||l).defaultInterop().read("default")}else{q.default(e).var(b).defaultInterop().prop(t)}}else if(a){q.default(e).read(t)}}else if(D){q.import();if(i){q.namespace(b||l)}else if(r||a){q.named(b,t)}}else{q.require();if(i){q.var(b||l).wildcardInterop()}else if((r||a)&&c){if(r){b=b!=="default"?b:l;q.var(b).read(t);q.defaultInterop()}else{q.var(l).read(t)}}else if(r){q.var(b).defaultInterop().prop(t)}else if(a){q.var(b).prop(t)}}}else if(d==="compiled"){if(g){q.import();if(i){q.default(b||l)}else if(r||a){q.default(l).read(b)}}else if(D){q.import();if(i){q.namespace(b||l)}else if(r||a){q.named(b,t)}}else{q.require();if(i){q.var(b||l)}else if(r||a){if(c){q.var(l).read(b)}else{q.prop(t).var(b)}}}}else if(d==="uncompiled"){if(r&&c){throw new Error("No live reference for commonjs default")}if(g){q.import();if(i){q.default(b||l)}else if(r){q.default(b)}else if(a){q.default(l).read(b)}}else if(D){q.import();if(i){q.default(b||l)}else if(r){q.default(b)}else if(a){q.named(b,t)}}else{q.require();if(i){q.var(b||l)}else if(r){q.var(b)}else if(a){if(c){q.var(l).read(b)}else{q.var(b).prop(t)}}}}else{throw new Error(`Unknown importedInterop "${d}".`)}const{statements:x,resultName:w}=q.done();this._insertStatements(x,_,v);if((r||a)&&h&&w.type!=="Identifier"){return u([n(0),w])}return w}_insertStatements(e,t="before",r=3){const a=this._programPath.get("body");if(t==="after"){for(let t=a.length-1;t>=0;t--){if(a[t].isImportDeclaration()){a[t].insertAfter(e);return}}}else{e.forEach((e=>{e._blockHoist=r}));const t=a.find((e=>{const t=e.node._blockHoist;return Number.isFinite(t)&&t<4}));if(t){t.insertBefore(e);return}}this._programPath.unshiftContainer("body",e)}}t["default"]=ImportInjector},408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"ImportInjector",{enumerable:true,get:function(){return a.default}});t.addDefault=addDefault;t.addNamed=addNamed;t.addNamespace=addNamespace;t.addSideEffect=addSideEffect;Object.defineProperty(t,"isModule",{enumerable:true,get:function(){return i.default}});var a=r(378);var i=r(898);function addDefault(e,t,r){return new a.default(e).addDefault(t,r)}function addNamed(e,t,r,i){return new a.default(e).addNamed(t,r,i)}function addNamespace(e,t,r){return new a.default(e).addNamespace(t,r)}function addSideEffect(e,t,r){return new a.default(e).addSideEffect(t,r)}},898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=isModule;function isModule(e){return e.node.sourceType==="module"}}};var t={};function __nccwpck_require__(r){var a=t[r];if(a!==undefined){return a.exports}var i=t[r]={exports:{}};var s=true;try{e[r](i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(380);module.exports=r})();
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Copyright JS Foundation and other contributors <https://js.foundation/>
|
|
2
|
+
|
|
3
|
+
This software consists of voluntary contributions made by many
|
|
4
|
+
individuals. For exact contribution history, see the revision history
|
|
5
|
+
available at https://github.com/lodash/lodash
|
|
6
|
+
|
|
7
|
+
The following license applies to all parts of this software except as
|
|
8
|
+
documented below:
|
|
9
|
+
|
|
10
|
+
====
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
13
|
+
a copy of this software and associated documentation files (the
|
|
14
|
+
"Software"), to deal in the Software without restriction, including
|
|
15
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
16
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
17
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
18
|
+
the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be
|
|
21
|
+
included in all copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
24
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
25
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
26
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
27
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
28
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
29
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
|
+
|
|
31
|
+
====
|
|
32
|
+
|
|
33
|
+
Copyright and related rights for sample code are waived via CC0. Sample
|
|
34
|
+
code is defined as all source code displayed within the prose of the
|
|
35
|
+
documentation.
|
|
36
|
+
|
|
37
|
+
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
|
38
|
+
|
|
39
|
+
====
|
|
40
|
+
|
|
41
|
+
Files located in the node_modules and vendor directories are externally
|
|
42
|
+
maintained libraries used by this software which have their own
|
|
43
|
+
licenses; we recommend you read them, as their terms may differ from the
|
|
44
|
+
terms above.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"babel-plugin-lodash","author":"Graeme Yeates <megawac@gmail.com> (https://github.com/megawac)","version":"3.3.4","license":"MIT","types":"index.d.ts"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { type UniBuilderInstance } from './rspack';
|
|
2
|
+
import { type UniBuilderWebpackInstance } from './webpack';
|
|
1
3
|
import type { CreateUniBuilderOptions } from './types';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
4
|
+
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
5
|
+
export { HtmlWebpackPlugin };
|
|
6
|
+
export type { CreateUniBuilderOptions, UniBuilderInstance, UniBuilderWebpackInstance, };
|
|
7
|
+
export type { BundlerChain, RsbuildPlugin, ChainedConfig, CopyPluginOptions, ChainIdentifier, NormalizedConfig, RspackConfig, CacheGroup, } from '@rsbuild/shared';
|
|
8
|
+
export type { UniBuilderConfig, UniBuilderPlugin } from './types';
|
|
5
9
|
export type { StartDevServerOptions } from './shared/devServer';
|
|
6
|
-
export declare function createUniBuilder(options: CreateUniBuilderOptions): Promise<
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export { logger } from '@rsbuild/core';
|
|
10
|
+
export declare function createUniBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderInstance>;
|
|
11
|
+
export { logger, type Rspack, type RsbuildContext, type RsbuildConfig, } from '@rsbuild/core';
|
|
12
|
+
export type { webpack, WebpackChain, WebpackConfig } from '@rsbuild/webpack';
|
|
10
13
|
export { RUNTIME_CHUNK_NAME } from './shared/constants';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,9 +17,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var src_exports = {};
|
|
20
30
|
__export(src_exports, {
|
|
31
|
+
HtmlWebpackPlugin: () => import_html_webpack_plugin.default,
|
|
21
32
|
RUNTIME_CHUNK_NAME: () => import_constants.RUNTIME_CHUNK_NAME,
|
|
22
33
|
createUniBuilder: () => createUniBuilder,
|
|
23
34
|
logger: () => import_core.logger
|
|
@@ -25,6 +36,7 @@ __export(src_exports, {
|
|
|
25
36
|
module.exports = __toCommonJS(src_exports);
|
|
26
37
|
var import_rspack = require("./rspack");
|
|
27
38
|
var import_webpack = require("./webpack");
|
|
39
|
+
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
|
|
28
40
|
var import_core = require("@rsbuild/core");
|
|
29
41
|
var import_constants = require("./shared/constants");
|
|
30
42
|
async function createUniBuilder(options) {
|
|
@@ -32,6 +44,7 @@ async function createUniBuilder(options) {
|
|
|
32
44
|
}
|
|
33
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
46
|
0 && (module.exports = {
|
|
47
|
+
HtmlWebpackPlugin,
|
|
35
48
|
RUNTIME_CHUNK_NAME,
|
|
36
49
|
createUniBuilder,
|
|
37
50
|
logger
|
package/dist/rspack/index.d.ts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import type { RsbuildConfig, RsbuildPlugin, RsbuildInstance } from '@rsbuild/core';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import type { StartDevServerOptions } from '../shared/devServer';
|
|
5
|
-
export declare function parseConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
2
|
+
import type { UniBuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions, OverridesUniBuilderInstance } from '../types';
|
|
3
|
+
export declare function parseConfig(uniBuilderConfig: UniBuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
6
4
|
rsbuildConfig: RsbuildConfig;
|
|
7
5
|
rsbuildPlugins: RsbuildPlugin[];
|
|
8
6
|
}>;
|
|
9
|
-
type UniBuilderInstance = Omit<RsbuildInstance
|
|
10
|
-
/**
|
|
11
|
-
* should be used in conjunction with the upper-layer framework:
|
|
12
|
-
*
|
|
13
|
-
* missing route.json (required in modern server)
|
|
14
|
-
*/
|
|
15
|
-
startDevServer: (options: StartDevServerOptions) => Promise<StartServerResult>;
|
|
16
|
-
};
|
|
7
|
+
export type UniBuilderInstance = Omit<RsbuildInstance, keyof OverridesUniBuilderInstance> & OverridesUniBuilderInstance;
|
|
17
8
|
export declare function createRspackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderInstance>;
|
|
18
|
-
export {};
|
package/dist/rspack/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(rspack_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(rspack_exports);
|
|
35
35
|
var import_core = require("@rsbuild/core");
|
|
36
36
|
var import_parseCommonConfig = require("../shared/parseCommonConfig");
|
|
37
|
+
var import_compatLegacyPlugin = require("../shared/compatLegacyPlugin");
|
|
37
38
|
async function parseConfig(uniBuilderConfig, options) {
|
|
38
39
|
var _uniBuilderConfig_output, _uniBuilderConfig_tools, _uniBuilderConfig_tools1;
|
|
39
40
|
const { rsbuildConfig, rsbuildPlugins } = await (0, import_parseCommonConfig.parseCommonConfig)(uniBuilderConfig, options);
|
|
@@ -44,9 +45,10 @@ async function parseConfig(uniBuilderConfig, options) {
|
|
|
44
45
|
if ((_uniBuilderConfig_tools = uniBuilderConfig.tools) === null || _uniBuilderConfig_tools === void 0 ? void 0 : _uniBuilderConfig_tools.babel) {
|
|
45
46
|
var _uniBuilderConfig_tools2;
|
|
46
47
|
const { pluginBabel } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-babel")));
|
|
48
|
+
const { pluginBabelPost } = await Promise.resolve().then(() => __toESM(require("./plugins/babel-post")));
|
|
47
49
|
rsbuildPlugins.push(pluginBabel({
|
|
48
50
|
babelLoaderOptions: (_uniBuilderConfig_tools2 = uniBuilderConfig.tools) === null || _uniBuilderConfig_tools2 === void 0 ? void 0 : _uniBuilderConfig_tools2.babel
|
|
49
|
-
}));
|
|
51
|
+
}), pluginBabelPost());
|
|
50
52
|
}
|
|
51
53
|
if (((_uniBuilderConfig_tools1 = uniBuilderConfig.tools) === null || _uniBuilderConfig_tools1 === void 0 ? void 0 : _uniBuilderConfig_tools1.styledComponents) !== false) {
|
|
52
54
|
var _uniBuilderConfig_tools3;
|
|
@@ -71,6 +73,14 @@ async function createRspackBuilder(options) {
|
|
|
71
73
|
rsbuild.addPlugins(rsbuildPlugins);
|
|
72
74
|
return {
|
|
73
75
|
...rsbuild,
|
|
76
|
+
addPlugins: (plugins, options2) => {
|
|
77
|
+
const warpedPlugins = plugins.map((plugin) => {
|
|
78
|
+
return (0, import_compatLegacyPlugin.compatLegacyPlugin)(plugin, {
|
|
79
|
+
cwd
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
rsbuild.addPlugins(warpedPlugins, options2);
|
|
83
|
+
},
|
|
74
84
|
startDevServer: async (options2 = {}) => {
|
|
75
85
|
const { startDevServer } = await Promise.resolve().then(() => __toESM(require("../shared/devServer")));
|
|
76
86
|
return startDevServer(rsbuild, options2, config);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var babel_post_exports = {};
|
|
30
|
+
__export(babel_post_exports, {
|
|
31
|
+
pluginBabelPost: () => pluginBabelPost
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(babel_post_exports);
|
|
34
|
+
var import_isEqual = __toESM(require("lodash/isEqual"));
|
|
35
|
+
var import_plugin_babel = require("@rsbuild/plugin-babel");
|
|
36
|
+
const pluginBabelPost = () => ({
|
|
37
|
+
name: "uni-builder:babel-post",
|
|
38
|
+
pre: [
|
|
39
|
+
"rsbuild:babel"
|
|
40
|
+
],
|
|
41
|
+
setup(api) {
|
|
42
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID }) => {
|
|
43
|
+
if (chain.module.rules.get(CHAIN_ID.RULE.JS)) {
|
|
44
|
+
const babelLoaderOptions = chain.module.rule(CHAIN_ID.RULE.JS).use(CHAIN_ID.USE.BABEL).get("options");
|
|
45
|
+
if (babelLoaderOptions && (0, import_isEqual.default)((0, import_plugin_babel.getDefaultBabelOptions)(), babelLoaderOptions)) {
|
|
46
|
+
chain.module.rule(CHAIN_ID.RULE.JS).uses.delete(CHAIN_ID.USE.BABEL);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
pluginBabelPost
|
|
55
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var compatLegacyPlugin_exports = {};
|
|
20
|
+
__export(compatLegacyPlugin_exports, {
|
|
21
|
+
compatLegacyPlugin: () => compatLegacyPlugin
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(compatLegacyPlugin_exports);
|
|
24
|
+
var import_shared = require("@rsbuild/shared");
|
|
25
|
+
var import_path = require("path");
|
|
26
|
+
function addDeprecatedWarning(pluginName, name, newName) {
|
|
27
|
+
import_shared.logger.warn(`Plugin(${pluginName})'s api '${name}' is deprecated${newName ? `, please use '${newName}' instead.` : "."}`);
|
|
28
|
+
}
|
|
29
|
+
function compatLegacyPlugin(plugin, extraInfo) {
|
|
30
|
+
return {
|
|
31
|
+
...plugin,
|
|
32
|
+
setup: (api) => {
|
|
33
|
+
const builderContext = new Proxy(api.context, {
|
|
34
|
+
get(target, prop) {
|
|
35
|
+
switch (prop) {
|
|
36
|
+
case "target":
|
|
37
|
+
addDeprecatedWarning(plugin.name, "context.target", "context.targets");
|
|
38
|
+
return target.targets;
|
|
39
|
+
case "srcPath":
|
|
40
|
+
addDeprecatedWarning(plugin.name, "context.srcPath");
|
|
41
|
+
return (0, import_path.join)(extraInfo.cwd, "src");
|
|
42
|
+
case "framework":
|
|
43
|
+
addDeprecatedWarning(plugin.name, "context.framework");
|
|
44
|
+
return "";
|
|
45
|
+
default: {
|
|
46
|
+
if (prop in target) {
|
|
47
|
+
return target[prop];
|
|
48
|
+
} else {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
set(_target, prop) {
|
|
55
|
+
import_shared.logger.error(`Context is readonly, you can not assign to the "context.${prop}" prop.`);
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const legacyAPI = {
|
|
60
|
+
...api,
|
|
61
|
+
context: builderContext,
|
|
62
|
+
getBuilderConfig: () => {
|
|
63
|
+
addDeprecatedWarning(plugin.name, "getBuilderConfig", "getRsbuildConfig");
|
|
64
|
+
return api.getRsbuildConfig();
|
|
65
|
+
},
|
|
66
|
+
modifyBuilderConfig: (fn) => {
|
|
67
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
68
|
+
addDeprecatedWarning(plugin.name, "modifyBuilderConfig", "modifyRsbuildConfig");
|
|
69
|
+
return fn(config, {
|
|
70
|
+
mergeBuilderConfig: mergeRsbuildConfig
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return plugin.setup(legacyAPI);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
compatLegacyPlugin
|
|
82
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StartDevServerOptions as RsbuildStartDevServerOptions, StartServerResult, RsbuildInstance } from '@rsbuild/shared';
|
|
2
|
-
import type { ModernDevServerOptionsNew } from '@modern-js/server';
|
|
3
|
-
import {
|
|
2
|
+
import type { Server, ModernDevServerOptionsNew } from '@modern-js/server';
|
|
3
|
+
import { UniBuilderConfig } from '../types';
|
|
4
4
|
type ServerOptions = Partial<Omit<ModernDevServerOptionsNew, 'config'>> & {
|
|
5
5
|
config?: Partial<ModernDevServerOptionsNew['config']>;
|
|
6
6
|
};
|
|
@@ -9,5 +9,8 @@ export type StartDevServerOptions = Omit<RsbuildStartDevServerOptions, 'printURL
|
|
|
9
9
|
defaultPort?: number;
|
|
10
10
|
serverOptions?: ServerOptions;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type UniBuilderStartServerResult = Omit<StartServerResult, 'server'> & {
|
|
13
|
+
server: Server;
|
|
14
|
+
};
|
|
15
|
+
export declare function startDevServer(rsbuild: RsbuildInstance, options: StartDevServerOptions | undefined, builderConfig: UniBuilderConfig): Promise<UniBuilderStartServerResult>;
|
|
13
16
|
export {};
|
package/dist/shared/devServer.js
CHANGED
|
@@ -107,7 +107,11 @@ async function startDevServer(rsbuild, options = {}, builderConfig) {
|
|
|
107
107
|
(0, import_shared.debug)("create dev server done");
|
|
108
108
|
await rsbuildServer.beforeStart();
|
|
109
109
|
const protocol = devConfig.https ? "https" : "http";
|
|
110
|
-
const urls = (0, import_shared.getAddressUrls)(
|
|
110
|
+
const urls = (0, import_shared.getAddressUrls)({
|
|
111
|
+
protocol,
|
|
112
|
+
port,
|
|
113
|
+
host
|
|
114
|
+
});
|
|
111
115
|
(0, import_shared.debug)("listen dev server");
|
|
112
116
|
await server.init();
|
|
113
117
|
return new Promise((resolve) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type RsbuildPlugin, type RsbuildConfig } from '@rsbuild/core';
|
|
2
|
-
import type { CreateBuilderCommonOptions,
|
|
2
|
+
import type { CreateBuilderCommonOptions, UniBuilderConfig } from '../types';
|
|
3
3
|
/** Determine if a file path is a CSS module when disableCssModuleExtension is enabled. */
|
|
4
4
|
export declare const isLooseCssModules: (path: string) => boolean;
|
|
5
|
-
export declare function parseCommonConfig(uniBuilderConfig:
|
|
5
|
+
export declare function parseCommonConfig(uniBuilderConfig: UniBuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
6
6
|
rsbuildConfig: RsbuildConfig;
|
|
7
7
|
rsbuildPlugins: RsbuildPlugin[];
|
|
8
8
|
}>;
|
|
@@ -34,6 +34,8 @@ __export(parseCommonConfig_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(parseCommonConfig_exports);
|
|
35
35
|
var import_shared = require("@rsbuild/shared");
|
|
36
36
|
var import_core = require("@rsbuild/core");
|
|
37
|
+
var import_plugin_toml = require("@rsbuild/plugin-toml");
|
|
38
|
+
var import_plugin_yaml = require("@rsbuild/plugin-yaml");
|
|
37
39
|
var import_plugin_react = require("@rsbuild/plugin-react");
|
|
38
40
|
var import_globalVars = require("./plugins/globalVars");
|
|
39
41
|
var import_runtimeChunk = require("./plugins/runtimeChunk");
|
|
@@ -91,8 +93,8 @@ async function getBrowserslistWithDefault(path, config, target) {
|
|
|
91
93
|
return DEFAULT_BROWSERSLIST[target];
|
|
92
94
|
}
|
|
93
95
|
async function parseCommonConfig(uniBuilderConfig, options) {
|
|
94
|
-
var _uniBuilderConfig_output, _uniBuilderConfig_output1, _uniBuilderConfig_output2, _uniBuilderConfig_html, _uniBuilderConfig_html1, _uniBuilderConfig_html2, _uniBuilderConfig_html3, _uniBuilderConfig_html4, _uniBuilderConfig_html5, _uniBuilderConfig_source, _uniBuilderConfig_output3, _uniBuilderConfig_security, _uniBuilderConfig_output4,
|
|
95
|
-
var _output, _output_distPath, _output1, _extraConfig, _html,
|
|
96
|
+
var _uniBuilderConfig_output, _uniBuilderConfig_output1, _uniBuilderConfig_output2, _uniBuilderConfig_html, _uniBuilderConfig_html1, _uniBuilderConfig_html2, _uniBuilderConfig_html3, _uniBuilderConfig_html4, _uniBuilderConfig_html5, _devServer_devMiddleware, _uniBuilderConfig_source, _uniBuilderConfig_output3, _uniBuilderConfig_security, _uniBuilderConfig_output4, _uniBuilderConfig_source1, _uniBuilderConfig_source2, _uniBuilderConfig_output5, _uniBuilderConfig_output6, _uniBuilderConfig_output7, _uniBuilderConfig_tools, _uniBuilderConfig_output8, _uniBuilderConfig_output9, _uniBuilderConfig_tools1;
|
|
97
|
+
var _output, _output_distPath, _output_distPath1, _output1, _extraConfig, _html, _extraConfig1;
|
|
96
98
|
const { cwd, frameworkConfigPath, entry, target } = options;
|
|
97
99
|
const rsbuildConfig = (0, import_shared.deepmerge)({}, uniBuilderConfig);
|
|
98
100
|
const { dev = {}, html = {}, output = {}, tools = {} } = rsbuildConfig;
|
|
@@ -106,6 +108,8 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
106
108
|
(_distPath = (_output = output).distPath) !== null && _distPath !== void 0 ? _distPath : _output.distPath = {};
|
|
107
109
|
var _html1;
|
|
108
110
|
(_html1 = (_output_distPath = output.distPath).html) !== null && _html1 !== void 0 ? _html1 : _output_distPath.html = "html";
|
|
111
|
+
var _server;
|
|
112
|
+
(_server = (_output_distPath1 = output.distPath).server) !== null && _server !== void 0 ? _server : _output_distPath1.server = "bundles";
|
|
109
113
|
var _polyfill;
|
|
110
114
|
(_polyfill = (_output1 = output).polyfill) !== null && _polyfill !== void 0 ? _polyfill : _output1.polyfill = "entry";
|
|
111
115
|
if (output.disableCssModuleExtension) {
|
|
@@ -169,11 +173,34 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
169
173
|
extraConfig.html.templateParameters = (_, { entryName }) => uniBuilderConfig.html.templateParametersByEntries[entryName];
|
|
170
174
|
delete html.templateParametersByEntries;
|
|
171
175
|
}
|
|
176
|
+
var _tools;
|
|
177
|
+
(_tools = (_extraConfig1 = extraConfig).tools) !== null && _tools !== void 0 ? _tools : _extraConfig1.tools = {};
|
|
178
|
+
extraConfig.tools.htmlPlugin = (config) => {
|
|
179
|
+
if (typeof config.templateParameters === "function") {
|
|
180
|
+
const originFn = config.templateParameters;
|
|
181
|
+
config.templateParameters = (...args) => {
|
|
182
|
+
const res = originFn(...args);
|
|
183
|
+
return {
|
|
184
|
+
title: config.title,
|
|
185
|
+
meta: void 0,
|
|
186
|
+
...res
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
};
|
|
172
191
|
if (dev.progressBar === void 0) {
|
|
173
192
|
dev.progressBar = true;
|
|
174
193
|
}
|
|
175
|
-
|
|
176
|
-
|
|
194
|
+
const devServer = (0, import_shared.mergeChainedOptions)({
|
|
195
|
+
defaults: {
|
|
196
|
+
devMiddleware: {
|
|
197
|
+
writeToDisk: (file) => !file.includes(".hot-update.")
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
options: tools.devServer,
|
|
201
|
+
mergeFn: import_shared.deepmerge
|
|
202
|
+
});
|
|
203
|
+
dev.writeToDisk = (_devServer_devMiddleware = devServer.devMiddleware) === null || _devServer_devMiddleware === void 0 ? void 0 : _devServer_devMiddleware.writeToDisk;
|
|
177
204
|
const server = (0, import_shared.isProd)() ? {} : {
|
|
178
205
|
port: dev.port,
|
|
179
206
|
host: dev.host
|
|
@@ -198,7 +225,9 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
198
225
|
(0, import_devtools.pluginDevtool)({
|
|
199
226
|
disableSourceMap: (_uniBuilderConfig_output3 = uniBuilderConfig.output) === null || _uniBuilderConfig_output3 === void 0 ? void 0 : _uniBuilderConfig_output3.disableSourceMap
|
|
200
227
|
}),
|
|
201
|
-
(0, import_emitRouteFile.pluginEmitRouteFile)()
|
|
228
|
+
(0, import_emitRouteFile.pluginEmitRouteFile)(),
|
|
229
|
+
(0, import_plugin_toml.pluginToml)(),
|
|
230
|
+
(0, import_plugin_yaml.pluginYaml)()
|
|
202
231
|
];
|
|
203
232
|
const checkSyntaxOptions = (_uniBuilderConfig_security = uniBuilderConfig.security) === null || _uniBuilderConfig_security === void 0 ? void 0 : _uniBuilderConfig_security.checkSyntax;
|
|
204
233
|
if (checkSyntaxOptions) {
|
|
@@ -214,15 +243,6 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
214
243
|
delete output.disableTsChecker;
|
|
215
244
|
delete tools.tsChecker;
|
|
216
245
|
}
|
|
217
|
-
if (!((_uniBuilderConfig_output5 = uniBuilderConfig.output) === null || _uniBuilderConfig_output5 === void 0 ? void 0 : _uniBuilderConfig_output5.disableSvgr)) {
|
|
218
|
-
var _uniBuilderConfig_output13;
|
|
219
|
-
const { pluginSvgr } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-svgr")));
|
|
220
|
-
rsbuildPlugins.push(pluginSvgr({
|
|
221
|
-
svgDefaultExport: ((_uniBuilderConfig_output13 = uniBuilderConfig.output) === null || _uniBuilderConfig_output13 === void 0 ? void 0 : _uniBuilderConfig_output13.svgDefaultExport) || "url"
|
|
222
|
-
}));
|
|
223
|
-
delete output.disableSvgr;
|
|
224
|
-
delete output.svgDefaultExport;
|
|
225
|
-
}
|
|
226
246
|
if ((_uniBuilderConfig_source1 = uniBuilderConfig.source) === null || _uniBuilderConfig_source1 === void 0 ? void 0 : _uniBuilderConfig_source1.resolveMainFields) {
|
|
227
247
|
var _uniBuilderConfig_source3;
|
|
228
248
|
const { pluginMainFields } = await Promise.resolve().then(() => __toESM(require("./plugins/mainFields")));
|
|
@@ -233,17 +253,27 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
233
253
|
const { pluginExtensionPrefix } = await Promise.resolve().then(() => __toESM(require("./plugins/extensionPrefix")));
|
|
234
254
|
rsbuildPlugins.push(pluginExtensionPrefix((_uniBuilderConfig_source4 = uniBuilderConfig.source) === null || _uniBuilderConfig_source4 === void 0 ? void 0 : _uniBuilderConfig_source4.resolveExtensionPrefix));
|
|
235
255
|
}
|
|
236
|
-
const remOptions = (
|
|
256
|
+
const remOptions = (_uniBuilderConfig_output5 = uniBuilderConfig.output) === null || _uniBuilderConfig_output5 === void 0 ? void 0 : _uniBuilderConfig_output5.convertToRem;
|
|
237
257
|
if (remOptions) {
|
|
238
258
|
const { pluginRem } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-rem")));
|
|
239
259
|
rsbuildPlugins.push(pluginRem(typeof remOptions === "boolean" ? {} : remOptions));
|
|
240
260
|
}
|
|
241
|
-
rsbuildPlugins.push((0, import_runtimeChunk.pluginRuntimeChunk)((
|
|
242
|
-
|
|
261
|
+
rsbuildPlugins.push((0, import_runtimeChunk.pluginRuntimeChunk)((_uniBuilderConfig_output6 = uniBuilderConfig.output) === null || _uniBuilderConfig_output6 === void 0 ? void 0 : _uniBuilderConfig_output6.disableInlineRuntimeChunk));
|
|
262
|
+
const { sourceBuild } = uniBuilderConfig.experiments || {};
|
|
263
|
+
if (sourceBuild) {
|
|
243
264
|
const { pluginSourceBuild } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-source-build")));
|
|
244
|
-
rsbuildPlugins.push(pluginSourceBuild());
|
|
265
|
+
rsbuildPlugins.push(pluginSourceBuild(sourceBuild === true ? {} : sourceBuild));
|
|
245
266
|
}
|
|
246
267
|
rsbuildPlugins.push((0, import_plugin_react.pluginReact)());
|
|
268
|
+
if (!((_uniBuilderConfig_output7 = uniBuilderConfig.output) === null || _uniBuilderConfig_output7 === void 0 ? void 0 : _uniBuilderConfig_output7.disableSvgr)) {
|
|
269
|
+
var _uniBuilderConfig_output13;
|
|
270
|
+
const { pluginSvgr } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-svgr")));
|
|
271
|
+
rsbuildPlugins.push(pluginSvgr({
|
|
272
|
+
svgDefaultExport: ((_uniBuilderConfig_output13 = uniBuilderConfig.output) === null || _uniBuilderConfig_output13 === void 0 ? void 0 : _uniBuilderConfig_output13.svgDefaultExport) || "url"
|
|
273
|
+
}));
|
|
274
|
+
delete output.disableSvgr;
|
|
275
|
+
delete output.svgDefaultExport;
|
|
276
|
+
}
|
|
247
277
|
const pugOptions = (_uniBuilderConfig_tools = uniBuilderConfig.tools) === null || _uniBuilderConfig_tools === void 0 ? void 0 : _uniBuilderConfig_tools.pug;
|
|
248
278
|
if (pugOptions) {
|
|
249
279
|
const { pluginPug } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-pug")));
|
|
@@ -57,6 +57,8 @@ const pluginSplitChunks = () => ({
|
|
|
57
57
|
}
|
|
58
58
|
chain.optimization.splitChunks({
|
|
59
59
|
...currentConfig,
|
|
60
|
+
// rspack chunks type mismatch with webpack
|
|
61
|
+
// @ts-expect-error
|
|
60
62
|
cacheGroups: {
|
|
61
63
|
...currentConfig.cacheGroups,
|
|
62
64
|
...(0, import_shared.createCacheGroups)(groups)
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeEnv, MetaOptions, ServerConfig, ScriptInject, RsbuildTarget, ChainedConfig, ChainedConfigWithUtils, InlineChunkTest, DevConfig, RequestHandler, RsbuildEntry } from '@rsbuild/shared';
|
|
1
|
+
import type { NodeEnv, MetaOptions, ServerConfig, ScriptInject, RsbuildTarget, ChainedConfig, ChainedConfigWithUtils, InlineChunkTest, DevConfig, RequestHandler, RsbuildEntry, PromiseOrNot, RsbuildPluginAPI } from '@rsbuild/shared';
|
|
2
2
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
3
3
|
import type { PluginAssetsRetryOptions } from '@rsbuild/plugin-assets-retry';
|
|
4
4
|
import type { PluginStyledComponentsOptions } from '@rsbuild/plugin-styled-components';
|
|
@@ -11,6 +11,9 @@ import type { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
|
|
|
11
11
|
import type { PluginCheckSyntaxOptions } from '@rsbuild/plugin-check-syntax';
|
|
12
12
|
import type { PluginPugOptions } from '@rsbuild/plugin-pug';
|
|
13
13
|
import type { PluginBabelOptions } from '@rsbuild/plugin-babel';
|
|
14
|
+
import type { AliasOption } from '@modern-js/utils';
|
|
15
|
+
import type { StartDevServerOptions, UniBuilderStartServerResult } from './shared/devServer';
|
|
16
|
+
import type { PluginSourceBuildOptions } from '@rsbuild/plugin-source-build';
|
|
14
17
|
export type CreateBuilderCommonOptions = {
|
|
15
18
|
entry?: RsbuildEntry;
|
|
16
19
|
frameworkConfigPath?: string;
|
|
@@ -20,7 +23,7 @@ export type CreateBuilderCommonOptions = {
|
|
|
20
23
|
};
|
|
21
24
|
export type CreateUniBuilderOptions = {
|
|
22
25
|
bundlerType: 'rspack' | 'webpack';
|
|
23
|
-
config:
|
|
26
|
+
config: UniBuilderConfig;
|
|
24
27
|
} & Partial<CreateBuilderCommonOptions>;
|
|
25
28
|
export type GlobalVars = Record<string, any>;
|
|
26
29
|
export type ChainedGlobalVars = ChainedConfigWithUtils<GlobalVars, {
|
|
@@ -40,13 +43,13 @@ export type DisableSourceMapOption = boolean | {
|
|
|
40
43
|
export type UniBuilderExtraConfig = {
|
|
41
44
|
tools?: {
|
|
42
45
|
styledComponents?: false | PluginStyledComponentsOptions;
|
|
43
|
-
devServer?: {
|
|
46
|
+
devServer?: ChainedConfig<{
|
|
44
47
|
before?: RequestHandler[];
|
|
45
48
|
after?: RequestHandler[];
|
|
46
49
|
client?: DevConfig['client'];
|
|
47
50
|
compress?: ServerConfig['compress'];
|
|
48
51
|
devMiddleware?: {
|
|
49
|
-
writeToDisk
|
|
52
|
+
writeToDisk?: DevConfig['writeToDisk'];
|
|
50
53
|
};
|
|
51
54
|
headers?: ServerConfig['headers'];
|
|
52
55
|
historyApiFallback?: ServerConfig['historyApiFallback'];
|
|
@@ -54,7 +57,7 @@ export type UniBuilderExtraConfig = {
|
|
|
54
57
|
https?: DevServerHttpsOptions;
|
|
55
58
|
setupMiddlewares?: DevConfig['setupMiddlewares'];
|
|
56
59
|
proxy?: ServerConfig['proxy'];
|
|
57
|
-
}
|
|
60
|
+
}>;
|
|
58
61
|
/**
|
|
59
62
|
* Configure the [Pug](https://pugjs.org/) template engine.
|
|
60
63
|
*/
|
|
@@ -97,6 +100,7 @@ export type UniBuilderExtraConfig = {
|
|
|
97
100
|
port?: number;
|
|
98
101
|
};
|
|
99
102
|
source?: {
|
|
103
|
+
alias?: AliasOption;
|
|
100
104
|
/**
|
|
101
105
|
* Define global variables. It can replace expressions like `process.env.FOO` in your code after compile.
|
|
102
106
|
*/
|
|
@@ -189,6 +193,7 @@ export type UniBuilderExtraConfig = {
|
|
|
189
193
|
* @deprecated use `html.title` instead
|
|
190
194
|
*/
|
|
191
195
|
titleByEntries?: Record<string, string>;
|
|
196
|
+
favicon?: string;
|
|
192
197
|
/**
|
|
193
198
|
* @deprecated use `html.favicon` instead
|
|
194
199
|
*/
|
|
@@ -227,7 +232,7 @@ export type UniBuilderExtraConfig = {
|
|
|
227
232
|
/**
|
|
228
233
|
* Enable the ability for source code building
|
|
229
234
|
*/
|
|
230
|
-
sourceBuild?: boolean
|
|
235
|
+
sourceBuild?: boolean | Pick<PluginSourceBuildOptions, 'sourceField' | 'resolvePriority'>;
|
|
231
236
|
};
|
|
232
237
|
};
|
|
233
238
|
export type SriOptions = {
|
|
@@ -235,4 +240,59 @@ export type SriOptions = {
|
|
|
235
240
|
enabled?: 'auto' | true | false;
|
|
236
241
|
hashLoading?: 'eager' | 'lazy';
|
|
237
242
|
};
|
|
238
|
-
export type
|
|
243
|
+
export type OverridesUniBuilderInstance = {
|
|
244
|
+
addPlugins: (plugins: UniBuilderPlugin[], options?: {
|
|
245
|
+
before?: string;
|
|
246
|
+
}) => void;
|
|
247
|
+
/**
|
|
248
|
+
* should be used in conjunction with the upper-layer framework:
|
|
249
|
+
*
|
|
250
|
+
* missing route.json (required in modern server)
|
|
251
|
+
*/
|
|
252
|
+
startDevServer: (options: StartDevServerOptions) => Promise<UniBuilderStartServerResult>;
|
|
253
|
+
};
|
|
254
|
+
export type UniBuilderContext = RsbuildPluginAPI['context'] & {
|
|
255
|
+
target: RsbuildPluginAPI['context']['targets'];
|
|
256
|
+
framework: string;
|
|
257
|
+
srcPath: string;
|
|
258
|
+
entry: Record<string, string | string[]>;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* make the plugins type looser to avoid type mismatch
|
|
262
|
+
*/
|
|
263
|
+
export type UniBuilderPluginAPI = {
|
|
264
|
+
[key in keyof RsbuildPluginAPI]: any;
|
|
265
|
+
} & {
|
|
266
|
+
/** The following APIs only type incompatibility */
|
|
267
|
+
onBeforeCreateCompiler: (fn: any) => void;
|
|
268
|
+
onAfterCreateCompiler: (fn: any) => void;
|
|
269
|
+
onBeforeBuild: (fn: any) => void;
|
|
270
|
+
modifyBundlerChain: (fn: any) => void;
|
|
271
|
+
getNormalizedConfig: () => any;
|
|
272
|
+
/** The following APIs need to be compatible */
|
|
273
|
+
context: UniBuilderContext;
|
|
274
|
+
getBuilderConfig: () => Readonly<any>;
|
|
275
|
+
modifyBuilderConfig: (fn: (config: any, utils: {
|
|
276
|
+
mergeBuilderConfig: <T>(...configs: T[]) => T;
|
|
277
|
+
}) => PromiseOrNot<any | void>) => void;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* compat legacy modern.js builder plugin
|
|
281
|
+
*/
|
|
282
|
+
export type UniBuilderPlugin = {
|
|
283
|
+
name: string;
|
|
284
|
+
setup: (api: UniBuilderPluginAPI) => PromiseOrNot<void>;
|
|
285
|
+
pre?: string[];
|
|
286
|
+
post?: string[];
|
|
287
|
+
remove?: string[];
|
|
288
|
+
};
|
|
289
|
+
export type UniBuilderConfig = {
|
|
290
|
+
dev?: RsbuildConfig['dev'];
|
|
291
|
+
html?: RsbuildConfig['html'];
|
|
292
|
+
output?: RsbuildConfig['output'];
|
|
293
|
+
performance?: RsbuildConfig['performance'];
|
|
294
|
+
security?: RsbuildConfig['security'];
|
|
295
|
+
tools?: RsbuildConfig['tools'];
|
|
296
|
+
source?: Omit<NonNullable<RsbuildConfig['source']>, 'alias'>;
|
|
297
|
+
plugins?: RsbuildConfig['plugins'];
|
|
298
|
+
} & UniBuilderExtraConfig;
|
package/dist/webpack/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { type RsbuildConfig, type RsbuildPlugin, type RsbuildInstance } from '@rsbuild/core';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
export declare function parseConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
2
|
+
import type { RsbuildProvider } from '@rsbuild/shared';
|
|
3
|
+
import type { UniBuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions, OverridesUniBuilderInstance } from '../types';
|
|
4
|
+
export declare function parseConfig(uniBuilderConfig: UniBuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
6
5
|
rsbuildConfig: RsbuildConfig;
|
|
7
6
|
rsbuildPlugins: RsbuildPlugin[];
|
|
8
7
|
}>;
|
|
9
|
-
type UniBuilderWebpackInstance = Omit<RsbuildInstance
|
|
10
|
-
startDevServer: (options: StartDevServerOptions) => Promise<StartServerResult>;
|
|
11
|
-
};
|
|
8
|
+
export type UniBuilderWebpackInstance = Omit<RsbuildInstance<RsbuildProvider<'webpack'>>, keyof OverridesUniBuilderInstance> & OverridesUniBuilderInstance;
|
|
12
9
|
export declare function createWebpackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderWebpackInstance>;
|
|
13
|
-
export {};
|
package/dist/webpack/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(webpack_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(webpack_exports);
|
|
35
35
|
var import_core = require("@rsbuild/core");
|
|
36
36
|
var import_parseCommonConfig = require("../shared/parseCommonConfig");
|
|
37
|
+
var import_compatLegacyPlugin = require("../shared/compatLegacyPlugin");
|
|
37
38
|
var import_moduleScopes = require("./plugins/moduleScopes");
|
|
38
39
|
var import_babel = require("./plugins/babel");
|
|
39
40
|
var import_react = require("./plugins/react");
|
|
@@ -94,6 +95,14 @@ async function createWebpackBuilder(options) {
|
|
|
94
95
|
]);
|
|
95
96
|
return {
|
|
96
97
|
...rsbuild,
|
|
98
|
+
addPlugins: (plugins, options2) => {
|
|
99
|
+
const warpedPlugins = plugins.map((plugin) => {
|
|
100
|
+
return (0, import_compatLegacyPlugin.compatLegacyPlugin)(plugin, {
|
|
101
|
+
cwd
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
rsbuild.addPlugins(warpedPlugins, options2);
|
|
105
|
+
},
|
|
97
106
|
startDevServer: async (options2 = {}) => {
|
|
98
107
|
const { startDevServer } = await Promise.resolve().then(() => __toESM(require("../shared/devServer")));
|
|
99
108
|
return startDevServer(rsbuild, options2, config);
|
|
@@ -68,6 +68,11 @@ const pluginBabel = (options) => ({
|
|
|
68
68
|
version: config2.output.enableLatestDecorators ? "2018-09" : "legacy"
|
|
69
69
|
};
|
|
70
70
|
const baseBabelConfig = isServer || isServiceWorker ? (0, import_node.getBabelConfigForNode)({
|
|
71
|
+
presetEnv: {
|
|
72
|
+
targets: [
|
|
73
|
+
"node >= 14"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
71
76
|
pluginDecorators: decoratorConfig
|
|
72
77
|
}) : (0, import_web.getBabelConfigForWeb)({
|
|
73
78
|
presetEnv: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/uni-builder",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.46.0",
|
|
4
4
|
"description": "Unified builder for Modern.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"main": "./dist/index.js",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"files": [
|
|
21
|
+
"compiled",
|
|
21
22
|
"dist"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
@@ -25,21 +26,23 @@
|
|
|
25
26
|
"@babel/preset-react": "^7.22.15",
|
|
26
27
|
"@babel/types": "^7.23.0",
|
|
27
28
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
28
|
-
"@rsbuild/babel-preset": "0.
|
|
29
|
-
"@rsbuild/core": "0.
|
|
30
|
-
"@rsbuild/plugin-assets-retry": "0.
|
|
31
|
-
"@rsbuild/plugin-babel": "0.
|
|
32
|
-
"@rsbuild/plugin-check-syntax": "0.
|
|
33
|
-
"@rsbuild/plugin-css-minimizer": "0.
|
|
34
|
-
"@rsbuild/plugin-pug": "0.
|
|
35
|
-
"@rsbuild/plugin-react": "0.
|
|
36
|
-
"@rsbuild/plugin-rem": "0.
|
|
37
|
-
"@rsbuild/plugin-source-build": "0.
|
|
38
|
-
"@rsbuild/plugin-styled-components": "0.
|
|
39
|
-
"@rsbuild/plugin-svgr": "0.
|
|
40
|
-
"@rsbuild/plugin-type-check": "0.
|
|
41
|
-
"@rsbuild/
|
|
42
|
-
"@rsbuild/
|
|
29
|
+
"@rsbuild/babel-preset": "0.3.3",
|
|
30
|
+
"@rsbuild/core": "0.3.3",
|
|
31
|
+
"@rsbuild/plugin-assets-retry": "0.3.3",
|
|
32
|
+
"@rsbuild/plugin-babel": "0.3.3",
|
|
33
|
+
"@rsbuild/plugin-check-syntax": "0.3.3",
|
|
34
|
+
"@rsbuild/plugin-css-minimizer": "0.3.3",
|
|
35
|
+
"@rsbuild/plugin-pug": "0.3.3",
|
|
36
|
+
"@rsbuild/plugin-react": "0.3.3",
|
|
37
|
+
"@rsbuild/plugin-rem": "0.3.3",
|
|
38
|
+
"@rsbuild/plugin-source-build": "0.3.3",
|
|
39
|
+
"@rsbuild/plugin-styled-components": "0.3.3",
|
|
40
|
+
"@rsbuild/plugin-svgr": "0.3.3",
|
|
41
|
+
"@rsbuild/plugin-type-check": "0.3.3",
|
|
42
|
+
"@rsbuild/plugin-toml": "0.3.3",
|
|
43
|
+
"@rsbuild/plugin-yaml": "0.3.3",
|
|
44
|
+
"@rsbuild/shared": "0.3.3",
|
|
45
|
+
"@rsbuild/webpack": "0.3.3",
|
|
43
46
|
"@swc/helpers": "0.5.3",
|
|
44
47
|
"babel-loader": "9.1.3",
|
|
45
48
|
"babel-plugin-import": "1.13.5",
|
|
@@ -61,18 +64,19 @@
|
|
|
61
64
|
"webpack": "^5.89.0",
|
|
62
65
|
"webpack-manifest-plugin": "5.0.0",
|
|
63
66
|
"webpack-subresource-integrity": "5.1.0",
|
|
64
|
-
"@modern-js/utils": "2.
|
|
65
|
-
"@modern-js/server": "2.
|
|
66
|
-
"@modern-js/prod-server": "2.
|
|
67
|
+
"@modern-js/utils": "2.46.0",
|
|
68
|
+
"@modern-js/server": "2.46.0",
|
|
69
|
+
"@modern-js/prod-server": "2.46.0"
|
|
67
70
|
},
|
|
68
71
|
"devDependencies": {
|
|
69
|
-
"@rsbuild/plugin-swc": "0.
|
|
72
|
+
"@rsbuild/plugin-swc": "0.3.3",
|
|
70
73
|
"@types/lodash": "^4.14.202",
|
|
71
74
|
"react": "^18.2.0",
|
|
72
75
|
"react-dom": "^18.2.0",
|
|
73
76
|
"typescript": "^5.3.0",
|
|
74
|
-
"@
|
|
75
|
-
"@scripts/vitest-config": "2.
|
|
77
|
+
"@modern-js/builder-plugin-node-polyfill": "2.46.0",
|
|
78
|
+
"@scripts/vitest-config": "2.46.0",
|
|
79
|
+
"@scripts/build": "2.46.0"
|
|
76
80
|
},
|
|
77
81
|
"publishConfig": {
|
|
78
82
|
"access": "public",
|