Make use of `@woltlab/r.js`
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 17 Nov 2022 14:32:52 +0000 (15:32 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 17 Nov 2022 14:32:52 +0000 (15:32 +0100)
extra/_buildCore.js
extra/_buildExternal.js

index 904ee82124ecf7d922cd0be87d06cd08e6ffb9fa..3d2de18aad374036cae653d80588690ec35242ff 100644 (file)
@@ -66,7 +66,6 @@ async function compile(destination, files, overrides) {
        //
        // step3) build rjs
        //
-       const rjsCmd = process.platform === "win32" ? "r.js.cmd" : "r.js";
        process.chdir("../../");
 
        {
@@ -77,7 +76,7 @@ async function compile(destination, files, overrides) {
 
                        console.time(name);
                        {
-                               childProcess.execSync(`${rjsCmd} -o ${configFile} name=${name} out=${name}.js`, {
+                               childProcess.execSync(`node ${__dirname}/node_modules/.bin/r.js -o ${configFile} name=${name} out=${name}.js`, {
                                        cwd: process.cwd(),
                                        stdio: [0, 1, 2],
                                });
index ae41687478e824b416aea7e55f0d87ed5c8c2f91..5512350b7392a51613d097509b8a241d9c5eb711 100644 (file)
@@ -60,7 +60,6 @@ fs.readdirSync("./")
         }
     });
 
-const rjsCmd = (process.platform === "win32") ? "r.js.cmd" : "r.js";
 rjsPaths.forEach(async path => {
     let buildConfig = `${path}require.build.js`;
     let outFilename = require(process.cwd() + `/${buildConfig}`).out;
@@ -73,7 +72,7 @@ rjsPaths.forEach(async path => {
         }
 
         console.time(outFilename);
-        childProcess.execSync(`${rjsCmd} -o require.build.js ${overrides}`, {
+        childProcess.execSync(`node ${__dirname}/node_modules/.bin/r.js -o require.build.js ${overrides}`, {
             cwd: path,
             stdio: [0, 1, 2]
         });