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

Commit e2b5367

Browse files
Merge branch 'master' into chore/plugin-name
2 parents 554160e + d68e05a commit e2b5367

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +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-
postBuild: async config => {
13+
module.exports = {
14+
onPostBuild: async config => {
1615
const files = {};
1716
const glob = `${config.constants.BUILD_DIR}/**/*.{gif,jpg,jpeg,png,svg}`;
1817
const paths = await globby(glob);
@@ -78,5 +77,4 @@ module.exports = () => {
7877
})
7978
);
8079
}
81-
};
8280
};

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: 3 additions & 2 deletions
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": {
@@ -29,6 +29,7 @@
2929
"keywords": [
3030
"image optimization",
3131
"netlify",
32-
"netlify plugin"
32+
"netlify plugin",
33+
"netlify-plugin"
3334
]
3435
}

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)