RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

An option for disabling inclusion of module data in compiled code #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using modules, I get some module data in the beginning of compiled code:
============================
PLOVR_MODULE_INFO={"app":[]};
PLOVR_MODULE_URIS={"app":"module_app.js"};
PLOVR_MODULE_USE_DEBUG_MODE=false;
============================

> When plovr generates the JavaScript for the modules, it includes some module 
data in global variables that are used for initialization, as shown above.

These global variables are intended for module manager (which responsible for 
module loading), right?

In my non-ajax project every module is separate page (with reloading) and I 
static link module to page with simple <script>-tag. So in such context there 
is no need of theese global variables.

It would be great to have an option in plovr config that disable appending of 
that data
(
Compilation.java:260, public void appendRootModuleInfo(Appendable appendable, 
boolean isDebugMode,
      Function<String, String> moduleNameToUri) throws IOException
).

How about boolean "append-module-data"?

Original issue reported on code.google.com by aleksam...@gmail.com on 11 Jun 2011 at 9:49

GoogleCodeExporter commented 9 years ago
Similar to my comment on http://code.google.com/p/plovr/issues/detail?id=40, 
this should also be a boolean option that is false by default, so it needs a 
different name.

Original comment by bolinf...@gmail.com on 16 Jun 2011 at 10:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
How about "experimental-exclude-module-data" (by analogy with
http://code.google.com/p/plovr/source/detail?r=49634d51cde2cdc74d21283fb332b9ae2
bcfbca4
)?

Original comment by aleksam...@gmail.com on 17 Jun 2011 at 9:31

GoogleCodeExporter commented 9 years ago
Sorry, I just realized that this is already possible using:

http://plovr.com/options.html#module-info-path

That writes the module info out to a file rather than including it in the root 
module. As explained in ConfigOption.java:

  /**
   * This option is used to write the plovr module info JS into a separate file
   * instead of prepending it to the root module. Prepending the JS causes the
   * source map to be several lines off in the root module, so doing this avoids
   * that issue.
   */

Original comment by bolinf...@gmail.com on 28 Oct 2011 at 4:05

GoogleCodeExporter commented 9 years ago

Original comment by bolinf...@gmail.com on 6 Nov 2011 at 7:49