mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Don't rebuild if installed by NPM package
This commit is contained in:
parent
72e104e722
commit
1cea3f39cb
13
build
13
build
|
|
@ -30,11 +30,6 @@ try {
|
|||
console.log('Installing dependencies...');
|
||||
shell('npm install');
|
||||
}
|
||||
// for some reason, esbuild won't be requirable until a tick has passed
|
||||
// see https://stackoverflow.com/questions/53270058/node-cant-find-certain-modules-after-synchronous-install
|
||||
setImmediate(() => {
|
||||
require('./tools/build-utils').transpile(force, decl);
|
||||
});
|
||||
|
||||
// Make sure config.js exists. If not, copy it over synchronously from
|
||||
// config-example.js, since it's needed before we can start the server
|
||||
|
|
@ -49,3 +44,11 @@ try {
|
|||
fs.readFileSync('config/config-example.js')
|
||||
);
|
||||
}
|
||||
|
||||
// for some reason, esbuild won't be requirable until a tick has passed
|
||||
// see https://stackoverflow.com/questions/53270058/node-cant-find-certain-modules-after-synchronous-install
|
||||
setImmediate(() => {
|
||||
// npm package, don't rebuild
|
||||
if (process.argv[2] === 'postinstall' && fs.existsSync('dist')) return;
|
||||
require('./tools/build-utils').transpile(force, decl);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
"test": "mocha",
|
||||
"posttest": "npm run tsc",
|
||||
"full-test": "npm run lint && npm run tsc && mocha --timeout 8000 --forbid-only -g \".*\"",
|
||||
"postinstall": "npm run build"
|
||||
"postinstall": "npm run build postinstall"
|
||||
},
|
||||
"bin": "./pokemon-showdown",
|
||||
"homepage": "http://pokemonshowdown.com",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user