aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
606 stars 52 forks source link

Duplicate content in the manifest.json #43

Closed jurijsk closed 2 years ago

jurijsk commented 2 years ago

Use of require() to load manifest file for manipulation, as shown in doc results in duplicated content of manifest.json file under default property as require and it it (at least for some confutations?).

Consider using require("...").default in the samples or even JSON.parse(fs.readFileSync("...").toString()).

Both option worked for me.

aklinker1 commented 2 years ago

The library actually exports a readJsonFile method that does all that for you. I've updated the docs to use it instead of require.