Strip comments during packaging to ignore commented require statements, etc.
Description
When a require statement exists in code comments, it's possible for it to be evaluated during the packaging process. When the statement doesn't resolve to a known file location, an error is thrown.
Strip comments during packaging to ignore commented require statements, etc.
Description
When a
require
statement exists in code comments, it's possible for it to be evaluated during the packaging process. When the statement doesn't resolve to a known file location, an error is thrown.Related Issue
https://jira.corp.adobe.com/browse/DTM-15226
Motivation and Context
How Has This Been Tested?
Tested using
node@v10.0.0
.master
ofreactor-packager
.npm link
inreactor-packager
directory.// require('./foobar.js')
to a file.npm link @adobe/reactor-packager
from my local extension project directorynpx @adobe/reactor-packager
from my local extension project directory. Observed an unknown file error thrown.reactor-packager
npx @adobe/reactor-packager
from my local extension project directory and observed no error thrown.Screenshots (if appropriate):
Types of changes
Checklist: