Skip to content

Commit 2ed21eb

Browse files
committed
fix load
1 parent 03cdb93 commit 2ed21eb

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

compile.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,17 @@ qx.Class.define("qxl.packagebrowser.compile.LibraryApi", {
1414

1515
members: {
1616
__pkgDataGenerated: false,
17-
require: function(module) {
18-
try {
19-
require.resolve(module);
20-
} catch (e) {
21-
if ( e.code === 'MODULE_NOT_FOUND' ) {
22-
this.loadNpmModule(module);
23-
}
24-
}
25-
return require(module);
26-
},
27-
28-
loadNpmModule: function(module) {
29-
const {execSync} = require("child_process");
30-
let s = `npm install --no-save --no-package-lock ${module}`;
31-
qx.tool.compiler.Console.info(s);
32-
execSync(s, {
33-
stdio: "inherit"
34-
});
35-
},
3617

3718
async load() {
3819
let command = this.getCompilerApi().getCommand();
39-
command.addListener("made", this.__onMade, this);
20+
if (command instanceof qx.tool.cli.commands.Compile) {
21+
command.addListener("made", this.__onMade, this);
22+
}
4023
},
4124

4225
/**
4326
* Generate the data needed by the packagebrowser application.
44-
* Triggered by the compiler's "writtenApplication" event.
27+
* Triggered by the compiler's "made" event.
4528
* @param {qx.event.type.Event} e
4629
* @return {Promise<void>}
4730
* @private

0 commit comments

Comments
 (0)