@bringhub/webpack-content-versioning

0.0.8 • Public • Published

Glob the pattern/s (comma separated), parse the content, add to webpack compilation assets, and prefix compilation hash to webpack entries.

//webpack.config.js
entry: {
  "app.js": "src/app.js",
  "app.css": "src/app.css",
},
plugins: [
  new ContentVersioning({
    src: "./src",        
    pattern: "**/*.html",
  }),
],
<!-- src/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
      <meta name="version" content="[commit]">
      <title>Advertiser | Bringhub</title>
      <link rel="stylesheet"
            type="text/css"
            href="[hash].app.css">
      <script defer
              src="[hash].app.js"></script>
</head>
</html>

src/app.js is output to dist/j281ajdhk12.app.js

src/index.html output to dist/index.html with the rendered hashes and git commit version

Readme

Keywords

none

Package Sidebar

Install

npm i @bringhub/webpack-content-versioning

Weekly Downloads

2

Version

0.0.8

License

ISC

Last publish

Collaborators

  • ben-bringhub
  • kiangj
  • tbasnett
  • bringhub-admin
  • itsleeowen
  • jlpotts
  • tampajohn