Files
handlebars.js/spec
Nils Knappmeier 79309659e1 Gracefully handle missing uglify-js dependency
closes #1391

uglify-js is an optional dependency and should be treated as such.
This commit gracefully handles MODULE_NOT_FOUND errors while loading
uglify.

- Check for existing uglify-js (and load uglify-js) only if minification
  was activated
- Use "require.resolve" to check if uglify exists. Otherwise, a missing
  dependency of uglify-js would cause the same behavior as missing
  uglify-js. (Only a warning, no error)
- The code to load and run uglify is put into a single for readability
  purposes
- Tests use a mockup Module._resolveFilename to simulate the missing module.
  This function is used by both "require" and "require.resolve", so both
  are mocked equally.

(cherry picked from commit d5caa56)
2017-10-17 22:18:56 +02:00
..
2014-11-08 14:35:23 -06:00
2017-08-23 22:29:30 +02:00
2015-09-01 01:43:00 -05:00
2015-08-03 23:43:00 -05:00
2015-08-18 23:57:27 -07:00
2015-09-01 17:56:32 -05:00
2015-08-22 10:59:34 -07:00
2015-09-01 17:56:32 -05:00
2015-04-16 16:43:01 -05:00
2015-09-23 21:59:58 -05:00
2015-09-01 17:56:32 -05:00
2015-04-16 16:43:01 -05:00
2015-08-22 11:13:08 -07:00
2015-04-16 16:43:01 -05:00
2015-09-01 17:56:32 -05:00
2015-04-16 16:43:01 -05:00
2015-04-16 16:43:01 -05:00
2015-08-03 12:16:02 -05:00
2015-09-01 01:44:35 -05:00
2015-08-22 10:59:34 -07:00
2015-04-16 16:43:01 -05:00