Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The manifest option is not working if output.filename is not specified in webpack config #91

Closed
2 of 6 tasks
lmichelin opened this issue Aug 31, 2021 · 1 comment
Closed
2 of 6 tasks
Labels
status: notabug The issue is not a bug as reported or not reproducible.

Comments

@lmichelin
Copy link
Contributor

Type:

  • bug
  • feature
  • enhancement
  • question

Environment:

  • OS: Ubuntu
  • Browser: N/A
  • Library Version: 1.1.8

I'm going to open a PR:

  • yes
  • no

Package options

new ExtReloader({
  reloadPage: true,
  manifest: "./src/manifest.json",
})

Description:
I was using webpack 4 and the webpack-extension-reloader package and it was working well without specifying output.filename in webpack config as the default behaviour ("[name].js") was ok for me. I decided to migrate to webpack 5 and to use this library instead of webpack-extension-reloader, but to make it work I needed to specify explicitly output.filename even if it's the default value.

If I don't specify the output.filename property, the manifest option is not working:

[webpack-cli] Error: 
    at Object.extractEntries (/home/xxxxxx/xxxxxxxxx/node_modules/webpack-ext-reloader/dist/webpack:/webpack-ext-reloader/src/utils/manifest.ts:21:11)
    at ExtensionReloaderImpl._registerPlugin (/home/xxxxxx/xxxxxxxxx/node_modules/webpack-ext-reloader/dist/webpack:/webpack-ext-reloader/src/ExtensionReloader.ts:93:9)
    at ExtensionReloaderImpl.apply (/home/xxxxxx/xxxxxxxxx/node_modules/webpack-ext-reloader/dist/webpack:/webpack-ext-reloader/src/ExtensionReloader.ts:128:12)
    at createCompiler (/home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/webpack.js:74:12)
    at /home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/webpack.js:44:48
    at Array.map (<anonymous>)
    at createMultiCompiler (/home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/webpack.js:44:33)
    at create (/home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/webpack.js:118:16)
    at webpack (/home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/webpack.js:135:47)
    at WebpackCLI.f [as webpack] (/home/xxxxxx/xxxxxxxxx/node_modules/webpack/lib/index.js:55:16)

Thanks for your support.

@rushilsrivastava
Copy link
Member

I can't confirm whether not specifying output.filename worked in the previous versions or not, but this seems to be an intentional design choice and is not a bug. Ref: v4 vs v5.

This is an intentional design choice because we want to ensure that the output matches that of what is in the manifest. In the meantime, I've added a more helpful error message.

rushilsrivastava added a commit that referenced this issue Jan 24, 2022
@rushilsrivastava rushilsrivastava added status: notabug The issue is not a bug as reported or not reproducible. status: wontfix The issue will not be fixed or otherwise handled. and removed type: bug A bug. status: wontfix The issue will not be fixed or otherwise handled. labels Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: notabug The issue is not a bug as reported or not reproducible.
Projects
None yet
Development

No branches or pull requests

2 participants