Skip to content

Commit

Permalink
Add back support for the assetPlugin option
Browse files Browse the repository at this point in the history
Summary:
**Summary**
Metro used to have support for "asset plugins", which allowed developers to specify arbitrary JS modules that could export a function for adding more fields to asset data objects. Some of this functionality was removed in the delta bundler work -- this PR adds it back.

**Test plan**
Made existing unit tests pass and added unit tests to test asset plugin behavior. Also tested E2E in a React Native project by adding `assetPlugin=/path/to/pluginModule` to a JS bundle URL and ensuring that the plugin ran.
Closes facebook/metro#118

Differential Revision: D6711094

Pulled By: rafeca

fbshipit-source-id: f42c54cfd11bac5103194f85083084eef25fa3cd
  • Loading branch information
ide authored and facebook-github-bot committed Jan 12, 2018
1 parent 2a22d99 commit af6450c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
filename: file,
localPath: file,
options: {
assetDataPlugins: [],
dev: true,
inlineRequires: true,
minify: false,
Expand Down

0 comments on commit af6450c

Please sign in to comment.