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

Fix browser build dev setup #1388

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Fix browser build dev setup #1388

merged 1 commit into from
Mar 11, 2021

Conversation

hwbllmnn
Copy link
Contributor

Description

This fixes the browser build dev setup.

Pull request type

  • Bugfix
  • Feature
  • Dependency updates
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)
  • I am unsure (we'll look into it together)

Do you introduce a breaking change?

  • Yes
  • No
  • I am unsure (no worries, we'll find out)

Checklist

  • I understand and agree that the changes in this PR will be licensed under the BSD 2-Clause License
  • I have followed the guidelines for contributing
  • The proposed change fits to the content of the code of conduct
  • I have added or updated tests and documentation, and the test suite passes (run npm test locally)
  • I'm lost; why do I have to check so many boxes? Please help!

@KaiVolland
Copy link
Collaborator

Can you explain why the MiniCssExtractPlugin causes the problem and removing solves it?

@KaiVolland
Copy link
Collaborator

Maybe removing the hmr option is sufficent.

@hwbllmnn
Copy link
Contributor Author

Maybe removing the hmr option is sufficent.

Perhaps it is, I didn't really analyze the problem. I noticed the dev build was not working any more and then compared the build config with the production browser build file and noticed that the plugin is not present there (at least not in the less section). So I just made sure that both builds work the same (minus the optimizations for prod obviously).

@KaiVolland
Copy link
Collaborator

The docs of MiniCssExtractPlugin say that hmr is deprecated for webpack 4. Maybe give it a try. If it's not working we can remove it completly.

@hwbllmnn
Copy link
Contributor Author

The docs of MiniCssExtractPlugin say that hmr is deprecated for webpack 4. Maybe give it a try. If it's not working we can remove it completly.

Why do you want to keep the plugin in the dev build only? I'd prefer to have the dev build as close to the prod build as possible.

@hwbllmnn
Copy link
Contributor Author

Also, removing the hmr option does not fix the problem. We get this error for all files:

ERROR in ./src/Component/Symbolizer/SLDRenderer/SLDRenderer.less
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ReferenceError: document is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants