Skip to content

awdltd/hash-webpack-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash plugin

PHP hash manifest file writer plugin

Quickly generated PHP hash variables for updated CSS, JS and more. Forked from xpepermint.

Setup

npm install --save-dev @awdltd/hash-plugin

Example

const FileHashSave = require('@awdltd/hash-plugin');

// Webpack.config
module.exports = {
  ...
  plugins: [
    new FileHashSave({
      path: './dist/js/',
      fileName: 'hash.php',
      assetType: 'JS'
    })
  ]
};
const {fileHashReplace} = require('@awdltd/hash-plugin');

// Generate hash (or use Gulp plugin)
let hash = Math.random().toString(36).substring(2, 7);

// Gulp task
gulp
  .src(`./dist/style.scss`)
  .pipe(
    ...
  )
  .on('end', function(){
    fileHashReplace('dist/css/hash.php', hash, 'CSS');
  };

About

Hash manifest file writer plugin for Webpack.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 100.0%