adobe / reactor-packager

Command line utility for packaging an Adobe Experience Platform Tags extension into a zip file.
Apache License 2.0
8 stars 6 forks source link

DTM-15226: Resolves #8. #14

Closed brenthosie closed 4 years ago

brenthosie commented 4 years ago

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.

  1. Pulled the latest of master of reactor-packager.
  2. Ran npm link in reactor-packager directory.
  3. Switched to local extension project and added // require('./foobar.js') to a file.
  4. Ran npm link @adobe/reactor-packager from my local extension project directory
  5. Ran npx @adobe/reactor-packager from my local extension project directory. Observed an unknown file error thrown.
  6. Implemented fix locally in reactor-packager
  7. Ran npx @adobe/reactor-packager from my local extension project directory and observed no error thrown.

Screenshots (if appropriate):

Types of changes

Checklist: