简体   繁体   中英

Run javascript at plovr compile-time

Is it possible to run javascript at compile time using plovr? (perhaps defining a variable in the config file).

For example, I would like a function that returns the time the script was compiled, something like this:

function compiledAt(){
    return #Date.now(); // #Date.now() to be processed at compile-time
}

So that after compilation, it would look like this:

function compiledAt(){
    return 1374580397271;
}

A few months later, I can update that it is not possible to do this using only javascript and Plovr.

Other options include:

  1. A script that makes a replace and then runs plover
  2. A customer compiler pass in Google Closure

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM