Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Webpack trainees.js with a separate config file. #61

Open
biancadanforth opened this issue Aug 20, 2018 · 0 comments
Open

Webpack trainees.js with a separate config file. #61

biancadanforth opened this issue Aug 20, 2018 · 0 comments

Comments

@biancadanforth
Copy link
Collaborator

biancadanforth commented Aug 20, 2018

PR #45 adds a new trainees.js script used for training Fathom. The current training process (as described in comments in trainees.js) involves manually copying over three files into the fathom-trainees add-on.

This is a little tedious, so it'd be nice if trainees.js and all its dependencies could be bundled into a single trainees.js file to be used for training. This training Webpack config would be different from our WE Webpack config (webpack.config.js) in a few notable ways:

  • Entry: trainees.js
  • Rules: Run only the ./extraction/ruleset_factory.js file through the babel-loader to enable use of the autobind decorator.
  • Output: Also call the bundled file trainees.js (rather than [name].bundle.js) to work with the fathom-trainees add-on and save the bundled file potentially to a training subfolder in ./src.
  • Configure Webpack such that it doesn't transform imports from specific libraries.
    • We wouldn't want Webpack to bundle fathom-web into the training bundle since those imports get processed by rollup in the fathom-trainees add-on.
  • This would also enable the use of the autobind decorator for the RulesetFactory class exported by ruleset_factory.js.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants