mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-29 11:37:47 -05:00
Don't build graphics.js by default
graphics.js will still be built by `./build full`, and once it already exists, `./build` will rebuild it when it's modified. Fixes #1150
This commit is contained in:
parent
fb4f83a580
commit
9019543dc1
9
build
9
build
|
|
@ -31,12 +31,14 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = {cwd: __dirname, stdio: 'inherit'};
|
var options = {cwd: __dirname, stdio: 'inherit'};
|
||||||
|
var full = '';
|
||||||
|
|
||||||
switch (process.argv[2] || '') {
|
switch (process.argv[2] || '') {
|
||||||
case 'full':
|
case 'full':
|
||||||
execSync(`node ./build-tools/build-indexes`, options);
|
execSync(`node ./build-tools/build-indexes`, options);
|
||||||
execSync(`node ./build-tools/build-learnsets`, options);
|
execSync(`node ./build-tools/build-learnsets`, options);
|
||||||
execSync(`node ./build-tools/build-minidex`, options);
|
execSync(`node ./build-tools/build-minidex`, options);
|
||||||
|
full = ' full';
|
||||||
break;
|
break;
|
||||||
case 'indexes':
|
case 'indexes':
|
||||||
execSync(`node ./build-tools/build-indexes`, options);
|
execSync(`node ./build-tools/build-indexes`, options);
|
||||||
|
|
@ -60,8 +62,11 @@ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
execSync(`node ./build-tools/update`, options);
|
execSync(`node ./build-tools/update` + full, options);
|
||||||
|
|
||||||
if (process.argv[2] === 'full') {
|
if (process.argv[2] === 'full') {
|
||||||
execSync(`node ../replay.pokemonshowdown.com/build`, options);
|
try {
|
||||||
|
fs.statSync('../replay.pokemonshowdown.com/build');
|
||||||
|
execSync(`node ../replay.pokemonshowdown.com/build`, options);
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,18 @@ console.log("DONE");
|
||||||
* Compile TS files
|
* Compile TS files
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
child_process.execSync(`node build-tools/babel-cli/bin/babel.js src --out-dir js --extensions ".ts,.tsx" --incremental`);
|
let ignoreGraphics = ' --ignore "src/battle-animations.js","src/battle-animations-moves.js"';
|
||||||
|
if (process.argv[2] === 'full') {
|
||||||
|
ignoreGraphics = '';
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
fs.statSync('data/graphics.js');
|
||||||
|
// graphics.js exists, recompile it
|
||||||
|
ignoreGraphics = '';
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
child_process.execSync(`node build-tools/babel-cli/bin/babel.js src --out-dir js --extensions ".ts,.tsx" --incremental${ignoreGraphics}`);
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
'js/battledata.js',
|
'js/battledata.js',
|
||||||
|
|
@ -47,11 +58,13 @@ fs.writeFileSync(
|
||||||
fs.readFileSync('src/battle-dex-misc.js')
|
fs.readFileSync('src/battle-dex-misc.js')
|
||||||
);
|
);
|
||||||
|
|
||||||
fs.writeFileSync(
|
if (!ignoreGraphics) {
|
||||||
'data/graphics.js',
|
fs.writeFileSync(
|
||||||
fs.readFileSync('js/battle-animations.js') + '\n\n' +
|
'data/graphics.js',
|
||||||
fs.readFileSync('js/battle-animations-moves.js')
|
fs.readFileSync('js/battle-animations.js') + '\n\n' +
|
||||||
);
|
fs.readFileSync('js/battle-animations-moves.js')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************
|
/*********************************************************
|
||||||
* Update cachebuster and News
|
* Update cachebuster and News
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,8 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||||
<script>
|
<script>
|
||||||
function loadRemoteData(src) {
|
function loadRemoteData(src) {
|
||||||
var elem = document.createElement('script');
|
// load synchronously
|
||||||
elem.src = src.replace(/.*\/?data\//g, 'https://play.pokemonshowdown.com/data/');
|
document.write('<script src="' + src.replace(/.*\/?data\//g, 'https://play.pokemonshowdown.com/data/') + '"><\/script>');
|
||||||
document.head.appendChild(elem);
|
|
||||||
}
|
}
|
||||||
var Config = {testclient: true};
|
var Config = {testclient: true};
|
||||||
(function() {
|
(function() {
|
||||||
|
|
@ -107,7 +106,7 @@
|
||||||
<script src="js/client-battle.js"></script>
|
<script src="js/client-battle.js"></script>
|
||||||
<script src="js/client-rooms.js"></script>
|
<script src="js/client-rooms.js"></script>
|
||||||
<script src="js/storage.js"></script>
|
<script src="js/storage.js"></script>
|
||||||
<script src="data/graphics.js"></script>
|
<script src="data/graphics.js" onerror="loadRemoteData(this.src)"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var app = new App();
|
var app = new App();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user