cordova - What's the right place for a hook to delete my typescript files? -


my cordova app code written in typescript there no reason these files should end in apk file.

but should put script delete these files in: before_build, before_clean, before_compile, before_prepare, before_run? or in respective 'after_' versions?

the github cordova-cli repo points here: apache.org hooks guide page doesn't describe each stage.

there few answers question, guess depends on how / when converting typescript files javascript (as process done hooks before_prepare hook.) short answer either after_prepare or before_compile.

let @ cli commands prepare, compile , build (source):

prepare [platform...] copies files specified platforms, or platforms.      ready building eclipse, xcode, etc.  compile [platform...] compiles app binary each targetted platform.      no parameters, builds platforms, otherwise builds      specified platforms.   build [<platform> [<platform> [...]]] alias cordova prepare followed      cordova compile 

before_prepare , before_build early, files haven't been copied on platform folder yet, , after_compile , after_build late package have been generated. leaves after_prepare , before_compile opportune time adjust files going packages.

however, think there nice alternative solution well. create separate folder in project root, typescript/. typescript files live. create before_prepare hook generate javascript files in appropriate www/ location. way build process automatically generate files, , since typescript files not live in www/ folder, not have remove typescript files before generating final package.

the jade example provided on hooks documentation starting point suggestion listed above (though jade files included outlines idea of generating files on build. again changing starting location of files outside www/ resolve this)


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -