Skip to content

Conversation

@marlowp
Copy link
Contributor

@marlowp marlowp commented May 13, 2025

Allows developers to build production-ready bundles with development features such as source maps by setting the MAPSTORE_COMPILE_DEV=true environment variable.

This is useful for deploying MapStore clients to environments like staging where full debug capability (e.g., unminified code and source maps) is required, while still including all assets (translations, configs, etc.).

Example usage from mapstore-client:
MAPSTORE_COMPILE_DEV=true mapstore-project compile && node postCompile

Changes:

  • Added isCompileDevMode toggle based on MAPSTORE_COMPILE_DEV env var
  • Conditionally set mode, prod, devtool, and version in the build config

This avoids the need for a separate dev-focused production build config and keeps the build logic centralised.

Closes #27

…ig.js for hybrid dev/prod builds

Allows developers to build production-ready bundles with development features
such as source maps by setting the MAPSTORE_DEV=true environment variable.

This is useful for deploying MapStore clients to environments like staging
where full debug capability (e.g., unminified code and source maps) is
required, while still including all assets (translations, configs, etc.).

Example usage from mapstore-client:
MAPSTORE_DEV=true mapstore-project compile && node postCompile

Changes:
- Added `isDevMode` toggle based on MAPSTORE_DEV env var
- Conditionally set `mode`, `prod`, `devtool`, and `version` in the build config

This avoids the need for a separate dev-focused production build config
and keeps the build logic centralised.
Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marlowp thanks for the contribution!
The only change I propose here is to use a more specific variable name because MAPSTORE_DEV seems referring to the dev environment.

@marlowp
Copy link
Contributor Author

marlowp commented Sep 25, 2025

Hi @marlowp thanks for the contribution! The only change I propose here is to use a more specific variable name because MAPSTORE_DEV seems referring to the dev environment.

Thanks for the review @allyoucanmap. Yep agree about the name change. I'll make that update.

@marlowp
Copy link
Contributor Author

marlowp commented Sep 25, 2025

@allyoucanmap this should be resolved now.

There is an accompanying PR in the geonode-mapstore-client repo that adds the npm command to use this. Are you able to take a look at that one as well?

GeoNode/geonode-mapstore-client#2056

@allyoucanmap allyoucanmap merged commit bb1f529 into geosolutions-it:master Oct 7, 2025
@allyoucanmap
Copy link
Contributor

Thanks @marlowp, merged on master

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.

Add MAPSTORE_COMPILE_DEV Environment Flag to prod-webpack.config.js for Dev-Like Debuggable Builds

2 participants