Skip to content

Improve defines and "production" modes. #25

Description

@davidlehn

Issue from #24.

The "production" situation is difficult to understand at the moment. Looking for suggestions on how it should be improved. The server code itself can be run with NODE_ENV=production, bedrock-views has a --bundle-mode option, and bedrock-webpack has a --webpack-mode option.

Right now, something like node app.js bundle --bundle-mode production will cause bedrock-views to set an optimization flag and bedrock-webpack to go into production mode and define process.env.NODE_ENV=production for the frontend. That can be a bit confusing as the frontend isn't Node.js! It's unclear if the wider community has a standard for that type of define.

Setting NODE_ENV=production when building just sets that for the builder itself. It doesn't currently pass that through to the frontend code. That was done to give control on what optimizations go into the output and allow for building of production code while retaining debugability. Some modern source map features reduce the need for that.

It might be better to use a different "define" or config value system for these frontend uses.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions