@modern-js/uni-builder 0.0.0-nightly-20231227170611 → 0.0.0-nightly-20231229170638
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 +5 -7
- package/dist/shared/devServer.d.ts +6 -3
- package/dist/shared/parseCommonConfig.d.ts +2 -2
- package/dist/shared/parseCommonConfig.js +4 -4
- package/dist/shared/plugins/frameworkConfig.js +3 -0
- package/dist/types.d.ts +13 -2
- package/dist/webpack/index.d.ts +6 -7
- package/package.json +23 -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 } 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,16 @@
|
|
|
1
1
|
import type { RsbuildConfig, RsbuildPlugin, RsbuildInstance } from '@rsbuild/core';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
export declare function parseConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
2
|
+
import type { UniBuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions } from '../types';
|
|
3
|
+
import type { StartDevServerOptions, UniBuilderStartServerResult } from '../shared/devServer';
|
|
4
|
+
export declare function parseConfig(uniBuilderConfig: UniBuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
6
5
|
rsbuildConfig: RsbuildConfig;
|
|
7
6
|
rsbuildPlugins: RsbuildPlugin[];
|
|
8
7
|
}>;
|
|
9
|
-
type UniBuilderInstance = Omit<RsbuildInstance
|
|
8
|
+
export type UniBuilderInstance = Omit<RsbuildInstance, 'startDevServer'> & {
|
|
10
9
|
/**
|
|
11
10
|
* should be used in conjunction with the upper-layer framework:
|
|
12
11
|
*
|
|
13
12
|
* missing route.json (required in modern server)
|
|
14
13
|
*/
|
|
15
|
-
startDevServer: (options: StartDevServerOptions) => Promise<
|
|
14
|
+
startDevServer: (options: StartDevServerOptions) => Promise<UniBuilderStartServerResult>;
|
|
16
15
|
};
|
|
17
16
|
export declare function createRspackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderInstance>;
|
|
18
|
-
export {};
|
|
@@ -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 {};
|
|
@@ -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
|
}>;
|
|
@@ -91,8 +91,8 @@ async function getBrowserslistWithDefault(path, config, target) {
|
|
|
91
91
|
return DEFAULT_BROWSERSLIST[target];
|
|
92
92
|
}
|
|
93
93
|
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, _uniBuilderConfig_output5, _uniBuilderConfig_source1, _uniBuilderConfig_source2, _uniBuilderConfig_output6, _uniBuilderConfig_output7, _uniBuilderConfig_experiments, _uniBuilderConfig_tools, _uniBuilderConfig_output8, _uniBuilderConfig_output9, _uniBuilderConfig_tools1;
|
|
95
|
-
var _output, _output_distPath, _output1, _extraConfig, _html
|
|
94
|
+
var _uniBuilderConfig_output, _uniBuilderConfig_output1, _uniBuilderConfig_output2, _uniBuilderConfig_html, _uniBuilderConfig_html1, _uniBuilderConfig_html2, _uniBuilderConfig_html3, _uniBuilderConfig_html4, _uniBuilderConfig_html5, _tools_devServer_devMiddleware, _tools_devServer, _uniBuilderConfig_source, _uniBuilderConfig_output3, _uniBuilderConfig_security, _uniBuilderConfig_output4, _uniBuilderConfig_output5, _uniBuilderConfig_source1, _uniBuilderConfig_source2, _uniBuilderConfig_output6, _uniBuilderConfig_output7, _uniBuilderConfig_experiments, _uniBuilderConfig_tools, _uniBuilderConfig_output8, _uniBuilderConfig_output9, _uniBuilderConfig_tools1;
|
|
95
|
+
var _output, _output_distPath, _output1, _extraConfig, _html;
|
|
96
96
|
const { cwd, frameworkConfigPath, entry, target } = options;
|
|
97
97
|
const rsbuildConfig = (0, import_shared.deepmerge)({}, uniBuilderConfig);
|
|
98
98
|
const { dev = {}, html = {}, output = {}, tools = {} } = rsbuildConfig;
|
|
@@ -172,8 +172,8 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
172
172
|
if (dev.progressBar === void 0) {
|
|
173
173
|
dev.progressBar = true;
|
|
174
174
|
}
|
|
175
|
-
var
|
|
176
|
-
(
|
|
175
|
+
var _tools_devServer_devMiddleware_writeToDisk;
|
|
176
|
+
dev.writeToDisk = (_tools_devServer_devMiddleware_writeToDisk = (_tools_devServer = tools.devServer) === null || _tools_devServer === void 0 ? void 0 : (_tools_devServer_devMiddleware = _tools_devServer.devMiddleware) === null || _tools_devServer_devMiddleware === void 0 ? void 0 : _tools_devServer_devMiddleware.writeToDisk) !== null && _tools_devServer_devMiddleware_writeToDisk !== void 0 ? _tools_devServer_devMiddleware_writeToDisk : (file) => !file.includes(".hot-update.");
|
|
177
177
|
const server = (0, import_shared.isProd)() ? {} : {
|
|
178
178
|
port: dev.port,
|
|
179
179
|
host: dev.host
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ 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';
|
|
14
15
|
export type CreateBuilderCommonOptions = {
|
|
15
16
|
entry?: RsbuildEntry;
|
|
16
17
|
frameworkConfigPath?: string;
|
|
@@ -20,7 +21,7 @@ export type CreateBuilderCommonOptions = {
|
|
|
20
21
|
};
|
|
21
22
|
export type CreateUniBuilderOptions = {
|
|
22
23
|
bundlerType: 'rspack' | 'webpack';
|
|
23
|
-
config:
|
|
24
|
+
config: UniBuilderConfig;
|
|
24
25
|
} & Partial<CreateBuilderCommonOptions>;
|
|
25
26
|
export type GlobalVars = Record<string, any>;
|
|
26
27
|
export type ChainedGlobalVars = ChainedConfigWithUtils<GlobalVars, {
|
|
@@ -97,6 +98,7 @@ export type UniBuilderExtraConfig = {
|
|
|
97
98
|
port?: number;
|
|
98
99
|
};
|
|
99
100
|
source?: {
|
|
101
|
+
alias?: AliasOption;
|
|
100
102
|
/**
|
|
101
103
|
* Define global variables. It can replace expressions like `process.env.FOO` in your code after compile.
|
|
102
104
|
*/
|
|
@@ -189,6 +191,7 @@ export type UniBuilderExtraConfig = {
|
|
|
189
191
|
* @deprecated use `html.title` instead
|
|
190
192
|
*/
|
|
191
193
|
titleByEntries?: Record<string, string>;
|
|
194
|
+
favicon?: string;
|
|
192
195
|
/**
|
|
193
196
|
* @deprecated use `html.favicon` instead
|
|
194
197
|
*/
|
|
@@ -235,4 +238,12 @@ export type SriOptions = {
|
|
|
235
238
|
enabled?: 'auto' | true | false;
|
|
236
239
|
hashLoading?: 'eager' | 'lazy';
|
|
237
240
|
};
|
|
238
|
-
export type
|
|
241
|
+
export type UniBuilderConfig = {
|
|
242
|
+
dev?: RsbuildConfig['dev'];
|
|
243
|
+
html?: RsbuildConfig['html'];
|
|
244
|
+
output?: RsbuildConfig['output'];
|
|
245
|
+
performance?: RsbuildConfig['performance'];
|
|
246
|
+
security?: RsbuildConfig['security'];
|
|
247
|
+
tools?: RsbuildConfig['tools'];
|
|
248
|
+
source?: Omit<NonNullable<RsbuildConfig['source']>, 'alias'>;
|
|
249
|
+
} & UniBuilderExtraConfig;
|
package/dist/webpack/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { type RsbuildConfig, type RsbuildPlugin, type RsbuildInstance } from '@rsbuild/core';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { StartDevServerOptions } from '../shared/devServer';
|
|
5
|
-
export declare function parseConfig(uniBuilderConfig:
|
|
2
|
+
import type { RsbuildProvider } from '@rsbuild/shared';
|
|
3
|
+
import type { UniBuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions } from '../types';
|
|
4
|
+
import type { StartDevServerOptions, UniBuilderStartServerResult } from '../shared/devServer';
|
|
5
|
+
export declare function parseConfig(uniBuilderConfig: UniBuilderConfig, options: CreateBuilderCommonOptions): Promise<{
|
|
6
6
|
rsbuildConfig: RsbuildConfig;
|
|
7
7
|
rsbuildPlugins: RsbuildPlugin[];
|
|
8
8
|
}>;
|
|
9
|
-
type UniBuilderWebpackInstance = Omit<RsbuildInstance
|
|
10
|
-
startDevServer: (options: StartDevServerOptions) => Promise<
|
|
9
|
+
export type UniBuilderWebpackInstance = Omit<RsbuildInstance<RsbuildProvider<'webpack'>>, 'startDevServer'> & {
|
|
10
|
+
startDevServer: (options: StartDevServerOptions) => Promise<UniBuilderStartServerResult>;
|
|
11
11
|
};
|
|
12
12
|
export declare function createWebpackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderWebpackInstance>;
|
|
13
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/uni-builder",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20231229170638",
|
|
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,21 @@
|
|
|
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.2.
|
|
29
|
-
"@rsbuild/core": "0.2.
|
|
30
|
-
"@rsbuild/plugin-assets-retry": "0.2.
|
|
31
|
-
"@rsbuild/plugin-babel": "0.2.
|
|
32
|
-
"@rsbuild/plugin-check-syntax": "0.2.
|
|
33
|
-
"@rsbuild/plugin-css-minimizer": "0.2.
|
|
34
|
-
"@rsbuild/plugin-pug": "0.2.
|
|
35
|
-
"@rsbuild/plugin-react": "0.2.
|
|
36
|
-
"@rsbuild/plugin-rem": "0.2.
|
|
37
|
-
"@rsbuild/plugin-source-build": "0.2.
|
|
38
|
-
"@rsbuild/plugin-styled-components": "0.2.
|
|
39
|
-
"@rsbuild/plugin-svgr": "0.2.
|
|
40
|
-
"@rsbuild/plugin-type-check": "0.2.
|
|
41
|
-
"@rsbuild/shared": "0.2.
|
|
42
|
-
"@rsbuild/webpack": "0.2.
|
|
29
|
+
"@rsbuild/babel-preset": "0.2.13",
|
|
30
|
+
"@rsbuild/core": "0.2.13",
|
|
31
|
+
"@rsbuild/plugin-assets-retry": "0.2.13",
|
|
32
|
+
"@rsbuild/plugin-babel": "0.2.13",
|
|
33
|
+
"@rsbuild/plugin-check-syntax": "0.2.13",
|
|
34
|
+
"@rsbuild/plugin-css-minimizer": "0.2.13",
|
|
35
|
+
"@rsbuild/plugin-pug": "0.2.13",
|
|
36
|
+
"@rsbuild/plugin-react": "0.2.13",
|
|
37
|
+
"@rsbuild/plugin-rem": "0.2.13",
|
|
38
|
+
"@rsbuild/plugin-source-build": "0.2.13",
|
|
39
|
+
"@rsbuild/plugin-styled-components": "0.2.13",
|
|
40
|
+
"@rsbuild/plugin-svgr": "0.2.13",
|
|
41
|
+
"@rsbuild/plugin-type-check": "0.2.13",
|
|
42
|
+
"@rsbuild/shared": "0.2.13",
|
|
43
|
+
"@rsbuild/webpack": "0.2.13",
|
|
43
44
|
"@swc/helpers": "0.5.3",
|
|
44
45
|
"babel-loader": "9.1.3",
|
|
45
46
|
"babel-plugin-import": "1.13.5",
|
|
@@ -61,18 +62,18 @@
|
|
|
61
62
|
"webpack": "^5.89.0",
|
|
62
63
|
"webpack-manifest-plugin": "5.0.0",
|
|
63
64
|
"webpack-subresource-integrity": "5.1.0",
|
|
64
|
-
"@modern-js/
|
|
65
|
-
"@modern-js/
|
|
66
|
-
"@modern-js/prod-server": "0.0.0-nightly-
|
|
65
|
+
"@modern-js/server": "0.0.0-nightly-20231229170638",
|
|
66
|
+
"@modern-js/utils": "0.0.0-nightly-20231229170638",
|
|
67
|
+
"@modern-js/prod-server": "0.0.0-nightly-20231229170638"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@rsbuild/plugin-swc": "0.2.
|
|
70
|
+
"@rsbuild/plugin-swc": "0.2.13",
|
|
70
71
|
"@types/lodash": "^4.14.202",
|
|
71
72
|
"react": "^18.2.0",
|
|
72
73
|
"react-dom": "^18.2.0",
|
|
73
74
|
"typescript": "^5.3.0",
|
|
74
|
-
"@scripts/build": "0.0.0-nightly-
|
|
75
|
-
"@scripts/vitest-config": "0.0.0-nightly-
|
|
75
|
+
"@scripts/build": "0.0.0-nightly-20231229170638",
|
|
76
|
+
"@scripts/vitest-config": "0.0.0-nightly-20231229170638"
|
|
76
77
|
},
|
|
77
78
|
"publishConfig": {
|
|
78
79
|
"access": "public",
|