Skip to content

Instantly share code, notes, and snippets.

@kumavis
Created June 5, 2020 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumavis/87e305d469c1433702ad8f54218812bb to your computer and use it in GitHub Desktop.
Save kumavis/87e305d469c1433702ad8f54218812bb to your computer and use it in GitHub Desktop.
LavaMoat webpack plugin requirements

LavaMoat

js tooling to help prevent attacks from evil dependencies.

read more here

lavamoat-webpack

webpack plugin for creating bundles protected by the LavaMoat kernel.

initial work here

requirements
  • primary

    • enforce or override some options
      • { optimization: { concatenateModules: false } } (we need this to ensure code is run as its own package)
      • if you cant override, then throw error if they are not set
    • render javascript to run in the lavamoat kernel
    • integrate a resolution hook
      • allow when x requires y to resolve to z example
      • or fallback to normal resolution
    • work correctly with popular webpack plugins like dev server
    • webpack v4
    • tests, at least a couple
  • stretch goal:

    • allow external tool to load webpack config, and
      • expose webpacks resolver as configured
      • load module code transformed as configured (maybe this is trivial, idk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment