DEV Community

Discussion on: Webpack Plugin for a chrome extension build

Collapse
 
egopingvina profile image
Aleksey Biryukov

I have a question about Solution 2. What should I write in the entry? Chrome extension has a background.js and a content.js. And if I don't mistake, both of them are entry points.

Collapse
 
jasmin profile image
Jasmin Virdi

Hi Aleksey,

So, the answer to your question is that you should ideally mention the js file or files which are called first when your extension is loaded.

Yes, there is an issue related to file path in the recent release. An update is already made for the fix!
Thanks for your reporting!
Happy Coding!😃

Collapse
 
thearchitgarg profile image
Archit Garg

Yes you should add both in your entry point because that would create two bundles in the build directory and you have to specify both in your manifest.json.

 entry: {
    background: "./path/to/my/entry/file.js",
    content_script: "./path/to/my/entry/file.js"
  }
Enter fullscreen mode Exit fullscreen mode