File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -791,7 +791,6 @@ class CodeInjector implements ICodeInjector {
791
791
const cwd = this . spaTmpPath ( ) ;
792
792
const serveDir = this . getServeDir ( ) ;
793
793
794
-
795
794
const sourcesHash = await this . computeSourcesHash ( this . spaTmpPath ( ) ) ;
796
795
797
796
const buildHash = await this . tryReadFile ( path . join ( serveDir , '.adminforth_build_hash' ) ) ;
@@ -805,7 +804,17 @@ class CodeInjector implements ICodeInjector {
805
804
console . log ( `🪲 SPA messages hash: ${ messagesHash } ` ) ;
806
805
console . log ( `🪲 SPA sources hash: ${ sourcesHash } ` ) ;
807
806
}
808
-
807
+
808
+ if ( ! skipBuild ) {
809
+ // remove serveDir if exists
810
+ try {
811
+ await fs . promises . rm ( serveDir , { recursive : true } ) ;
812
+ } catch ( e ) {
813
+ // ignore
814
+ }
815
+ await fs . promises . mkdir ( serveDir , { recursive : true } ) ;
816
+ }
817
+
809
818
if ( ! skipExtract ) {
810
819
await this . runNpmShell ( { command : 'run i18n:extract' , cwd} ) ;
811
820
@@ -823,13 +832,6 @@ class CodeInjector implements ICodeInjector {
823
832
824
833
if ( ! hotReload ) {
825
834
if ( ! skipBuild ) {
826
- // remove serveDir if exists
827
- try {
828
- await fs . promises . rm ( serveDir , { recursive : true } ) ;
829
- } catch ( e ) {
830
- // ignore
831
- }
832
- await fs . promises . mkdir ( serveDir , { recursive : true } ) ;
833
835
834
836
// TODO probably add option to build with tsh check (plain 'build')
835
837
await this . runNpmShell ( { command : 'run build-only' , cwd} ) ;
You can’t perform that action at this time.
0 commit comments