@@ -28,7 +28,8 @@ SOFTWARE.
2828
2929 let coreModules = new Map ( [ ] ) ;
3030
31- let basePath = "plugins/" ;
31+ let basePath = ll . pluginsRoot ;
32+ if ( ! basePath . endsWith ( "/" ) ) basePath += "/" ;
3233
3334 let utilPath = {
3435 normalize ( path ) {
@@ -135,9 +136,9 @@ SOFTWARE.
135136 throw new Error ( "cannot require file out of root dir" ) ;
136137 }
137138 path = path . replace ( / ^ \/ / , "" ) ;
138- let cjsSelf = "plugins/cjs .js";
139+ let cjsSelf = basePath + "lib/BaseLib .js";
139140 if ( path === cjsSelf ) {
140- throw new Error ( "cjs .js is trying to load itself" ) ;
141+ throw new Error ( "BaseLib .js is trying to load itself" ) ;
141142 }
142143 requestPaths . push ( path ) ;
143144 let content = file . readFrom ( path ) ;
@@ -173,7 +174,7 @@ SOFTWARE.
173174 }
174175 result = tryFile ( `${ id } .json` ) ;
175176 if ( result != undefined ) {
176- throw new Error ( `cannot require a JSON file ${ id } .mjs ` ) ;
177+ throw new Error ( `cannot require a JSON file ${ id } .json ` ) ;
177178 }
178179 result = tryFile ( `${ id } .mjs` ) ;
179180 if ( result != undefined ) {
@@ -194,7 +195,7 @@ SOFTWARE.
194195 }
195196 result = tryFile ( utilPath . join ( id , "index.json" ) ) ;
196197 if ( result != undefined ) {
197- throw new Error ( `cannot require a JSON file ${ id } .mjs ` ) ;
198+ throw new Error ( `cannot require a JSON file ${ id } .json ` ) ;
198199 }
199200 result = tryFile ( utilPath . join ( id , "index.mjs" ) ) ;
200201 if ( result != undefined ) {
@@ -229,7 +230,7 @@ SOFTWARE.
229230 let dirs = node_modules_paths ( start ) ;
230231 let result ;
231232 for ( let dir of dirs ) {
232- result = loadPackagExports ( utilPath . join ( dir , id ) ) ;
233+ result = loadPackageExports ( utilPath . join ( dir , id ) ) ;
233234 if ( result != undefined ) {
234235 return result ;
235236 }
@@ -271,7 +272,7 @@ SOFTWARE.
271272 return undefined ;
272273 }
273274
274- function loadPackagExports ( id ) {
275+ function loadPackageExports ( id ) {
275276 //TODO
276277 let package = file . readFrom ( utilPath . join ( id , "package.json" ) ) ;
277278 if ( package == undefined ) {
0 commit comments