Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 5db1aa2

Browse files
Merge branch 'master' into chore/fix-keyword
2 parents 68b3de7 + 9a46b2b commit 5db1aa2

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ const optipng = require("imagemin-optipng");
1010
const pngquant = require("imagemin-pngquant");
1111
const svgo = require("imagemin-svgo");
1212

13-
module.exports = () => {
14-
return {
15-
name: "netlify-plugin-image-optim",
16-
17-
postBuild: async config => {
13+
module.exports = {
14+
onPostBuild: async config => {
1815
const files = {};
1916
const glob = `${config.constants.BUILD_DIR}/**/*.{gif,jpg,jpeg,png,svg}`;
2017
const paths = await globby(glob);
@@ -80,5 +77,4 @@ module.exports = () => {
8077
})
8178
);
8279
}
83-
};
8480
};

manifest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: netlify-plugin-image-optim
2+
inputs: []

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netlify-plugin-image-optim",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Optimize images as part of your Netlify build process.",
55
"main": "index.js",
66
"scripts": {

readme.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ Optimize images as part of your Netlify build process. Optimizes PNG, JPEG, GIF
88

99
## Install
1010

11-
```
12-
npm i netlify-plugin-image-optim
13-
```
14-
15-
## Use
11+
To install, add the following lines to your `netlify.toml` file:
1612

17-
Add as a plugin to your Netlify config file.
18-
19-
```yaml
20-
plugins:
21-
- type: "netlify-plugin-image-optim"
13+
```toml
14+
[[plugins]]
15+
package = "netlify-plugin-image-optim"
2216
```
17+
18+
Note: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already.

0 commit comments

Comments
 (0)