Coder Social home page Coder Social logo

waysact / webpack-subresource-integrity Goto Github PK

View Code? Open in Web Editor NEW
354.0 14.0 47.0 4.1 MB

Webpack plugin for enabling Subresource Integrity.

License: MIT License

Emacs Lisp 0.13% JavaScript 10.50% TypeScript 89.37%
webpack sri html-webpack-plugin subresource-integrity

webpack-subresource-integrity's Introduction

webpack-subresource-integrity

npm version Build Status Coverage Status License

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.

Installing from source

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.)

Running tests

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

Adding a new test

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:

  • When 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.
  • The package must have nyc installed for coverage reporting to work.
  • The package must specify * as the version for webpack-subresource-integrity so that it picks up the version from inside the workspace (instead of using a published version.)
  • The package should use expect for testing expectations.
  • The package should make sure all versions it uses for nyc, expect, webpack etc. match those used in other examples, unless there's a good reason to use a different version.
  • If the example is an end-to-end test (runs tests in the browser) it should use wsi-test-helper to do so. See its README for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.