https://github.com/lucasvinals/changeextensionplugin
Connector for HtmlWebpackPlugin and CompressionWebpackPlugin :sunglasses:
https://github.com/lucasvinals/changeextensionplugin
compression compression-webpack-plugin html-webpack-plugin webpack webpack2
Last synced: 2 months ago
JSON representation
Connector for HtmlWebpackPlugin and CompressionWebpackPlugin :sunglasses:
- Host: GitHub
- URL: https://github.com/lucasvinals/changeextensionplugin
- Owner: lucasvinals
- License: mit
- Created: 2017-06-28T22:52:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T16:42:38.000Z (about 8 years ago)
- Last Synced: 2025-05-17T15:40:30.905Z (11 months ago)
- Topics: compression, compression-webpack-plugin, html-webpack-plugin, webpack, webpack2
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChangeExtensionPlugin
This plugin helps changing extensions of assets and scripts
in order to use **HtmlWebpackPlugin** ()
and **CompressionWebpackPlugin** () together.
**Installation**
*with yarn* `yarn add change-extension-plugin lodash`
*with npm* `npm install change-extension-plugin lodash --save`
**Include in your project**
`const ChangeExtensionPlugin = require('change-extension-plugin');`
**Use like this**
```
plugins: [
new CompressionPlugin(
{
algorithm: 'gzip',
threshold: 10240,
deleteOriginalAssets: true,
}
),
new HTMLWebpackPlugin(
{
template: './public/index.html',
filename: './views/index.html',
}
),
new ChangeExtensionPlugin(
{
/**
* These are the extensions of files that
* will be changed after html is processed.
*/
extensions: ['js', 'css'],
/**
* Extension of the compression method.
* 'gz' by default
*/
compressionMethod: 'gz',
}
),
]
```
*That's all!*