Sfoglia il codice sorgente

Remove constant __AR_DEVELOPMENT_MODE__

customisations
alemart 7 mesi fa
parent
commit
e10ea3512b
2 ha cambiato i file con 2 aggiunte e 7 eliminazioni
  1. 1
    2
      esbuild.mjs
  2. 1
    5
      src/main.ts

+ 1
- 2
esbuild.mjs Vedi File

5
 const argv = process.argv.slice(2);
5
 const argv = process.argv.slice(2);
6
 const json = await readFile(new URL('./package.json', import.meta.url), { encoding: 'utf8' });
6
 const json = await readFile(new URL('./package.json', import.meta.url), { encoding: 'utf8' });
7
 const pack = JSON.parse(json);
7
 const pack = JSON.parse(json);
8
-const production = (argv.indexOf('--dev') < 0);
8
+const production = (pack.version.indexOf('-dev') < 0);
9
 const minify = (argv.indexOf('--minify') >= 0);
9
 const minify = (argv.indexOf('--minify') >= 0);
10
 const serve = (argv.indexOf('--serve') >= 0);
10
 const serve = (argv.indexOf('--serve') >= 0);
11
 
11
 
23
     globalName: 'AR',
23
     globalName: 'AR',
24
     define: {
24
     define: {
25
         __AR_VERSION__: JSON.stringify(pack.version),
25
         __AR_VERSION__: JSON.stringify(pack.version),
26
-        __AR_DEVELOPMENT_MODE__: String(!production),
27
         __AR_WEBSITE__: JSON.stringify(pack.homepage),
26
         __AR_WEBSITE__: JSON.stringify(pack.homepage),
28
     },
27
     },
29
     legalComments: 'inline',
28
     legalComments: 'inline',

+ 1
- 5
src/main.ts Vedi File

32
 import { Utils } from './utils/utils';
32
 import { Utils } from './utils/utils';
33
 
33
 
34
 declare const __AR_VERSION__: string;
34
 declare const __AR_VERSION__: string;
35
-declare const __AR_DEVELOPMENT_MODE__: string;
36
 declare const __AR_WEBSITE__: string;
35
 declare const __AR_WEBSITE__: string;
37
 
36
 
38
 /**
37
 /**
64
      */
63
      */
65
     static get version(): string
64
     static get version(): string
66
     {
65
     {
67
-        if(__AR_DEVELOPMENT_MODE__)
68
-            return __AR_VERSION__ + '-dev';
69
-        else
70
-            return __AR_VERSION__;
66
+        return __AR_VERSION__;
71
     }
67
     }
72
 
68
 
73
     /**
69
     /**

Loading…
Annulla
Salva