stealjs / steal-tools

Build easy. Load fast.
https://stealjs.com/docs/steal-tools.html
MIT License
67 stars 23 forks source link

Makes process available for the global shim #1025

Closed justinbmeyer closed 6 years ago

justinbmeyer commented 6 years ago

For #1024

This adds a bundle/add_process_shim that adds a process object similar to the one steal's npm package does. This shim is added by default, unless noProcessShim is true (similar to noGlobalShim).

Furthermore, add_process_shim will use options.env as the env.NODE_ENV. This defaults to "development".

There are tests for both the default development and env: "production" cases.

problems / considerations:

  1. This duplicates the global identifying code. I'm not sure how we could avoid this.
  2. The steal process shim's cwd defaults to steal.baseUrl. I defaulted it to "".
  3. Steal 2.0 will need to merge and release this.
  4. There's no documentation around noProcessShim and env.
  5. There's not a test for noGlobalShim.