Skip to content

Commit 62449bd

Browse files
committed
README: ESM/CJS usage fix
1 parent dc1eb34 commit 62449bd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,21 @@ Into...
2020
- npm: `npm install --save-dev eleventy-auto-cache-buster`
2121
2. Enable the plugin
2222
```js
23-
// .eleventy.js
23+
// .eleventy.js (ESM)
2424
import eleventyAutoCacheBuster from "eleventy-auto-cache-buster";
2525

26-
module.exports = function (eleventyConfig) {
26+
export default function (eleventyConfig) {
2727
eleventyConfig.addPlugin(eleventyAutoCacheBuster);
2828
// ...
2929
}
3030

31-
// Alternatively, you can use CJS
31+
// .eleventy.js (CommonJS)
3232
const eleventyAutoCacheBuster = require("eleventy-auto-cache-buster").default;
33+
34+
module.exports = function (eleventyConfig) {
35+
eleventyConfig.addPlugin(eleventyAutoCacheBuster);
36+
// ...
37+
}
3338
```
3439

3540
3. That's it! No further changes are required.

0 commit comments

Comments
 (0)