Resolvesinstructure/canvas-lms#1101
In production, generate separate sourcemap files so that bundles appear
split into their original, un-obfuscated source files in browser
devtools.
Note: `source-map` generation on large projects can cause node/v8 to
exhaust its memory allocation (see webpack/webpack#1914,
webpack/webpack#2157). This is the reason for the change to
package.json. In the future (e.g. when Canvas uses Node 8, or the
NODE_OPTIONS feature is back-ported to Node 6, this can go back to
a traditional npm script that doesn't directly invoke `node`.
Test Plan:
- Remove the `public/dist/webpack-*` directories.
- Run `JS_BUILD_NO_UGLIFY=true npm run webpack-production`. No sourcemap
files should be present in `public/dist/webpack-production`.
- Run `npm run webpack-production`. Sourcemap files should be present in
`public/dist/webpack-production`
Change-Id: Iebc85b5f52a6c7c25fdc5c2326cf9436dd42c2dd
Reviewed-on: https://gerrit.instructure.com/128070
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>