If you're looking for installation and usage instructions, visit the main package.
Or you might be looking for the 1.x version with support for Webpack 1-4 and older versions of html-webpack-plugin? Visit the 1.x branch.
Upgrading from version 1.x? Read the migration guide.
If you want to hack on the package, read on — you're in the right place.
To install from source, clone this repository, cd into it and run
yarn
Note: this repository uses yarn workspaces; you have to use a recent version of Yarn, npm won't work. (This limitation does not apply to the built package; you can install that with npm, yarn, or any other package manager.)
The following will run all unit tests, integration tests, examples, and lint. It will also build the package and run a smoke test on the resulting tarball:
yarn check
The easiest way to add a new test is to create an example, which is an
integration test. An example is a self-contained package in directory
example
. It should follow these simple rules:
yarn webpack
is invoked inside the package, it returns a zero
exit code for a test pass, and a non-zero exit code for a test
failure.nyc
installed for coverage reporting to
work.*
as the version for
webpack-subresource-integrity
so that it picks up the version from
inside the workspace (instead of using a published version.)expect
for testing expectations.nyc
,
expect
, webpack
etc. match those used in other examples, unless
there's a good reason to use a different version.