Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome extension, how to ignore node_modules to load faster in development

I'm building a Chrome extension and I'm relying on some NPM modules. While I do have webpack to help packaging stuff for production environment, it seems that Chrome takes the entire directory into account when loading my unpacked extension during development, which is roughly 340M! This also makes debugging and testing a drag because click open the Chrome extension pop up takes 3 ~ 5 seconds.

I've been googling whether there is an option in the manifest.json file but nothing helpful came up. Did I miss something obvious?

If I hadn't, what is the recommended workflow? Should I output everything into a /dist folder and have my manifest.json file there?

like image 313
benjaminz Avatar asked Sep 11 '18 19:09

benjaminz


1 Answers

You need to place manifest.json inside your dist folder instead of the root of your project:

/
|- webpack.config.js
|- package.json
|- node_modules/
+- dist/
     |- manifest.json
     +- contentscript.js

There's no way to exclude files from a manifest.

like image 97
fregante Avatar answered Nov 03 '22 13:11

fregante