Bedrock is intended as a prototyping tool. The choices made were made so that we can quickly build interfaces and large prototypes. We specifically use the best templating language out there and we provide systems to build component styleguides in a fast manner.
However, Bedrock can also be used to build a final website or web app. Through a configuration file you can set up specific flags for production to compress CSS and JS. You can choose to enable or disable the prototype-specific features depending on your use cases (page tree and styleguide)
When moving from prototype to production, there are a few things to note.
Let’s say that you want to convert a Bedrock prototype to another development environment. The easiest way to do this is to:
sidebar: The main template is wrapped in a
br-prototype-wrapperwhich should be removed. This is to make the page tree work. Take the contents of
br-prototype-contentand make this your “root” div in the actual implementation.
fixedto get rid of the markup, or even set the entire
pageTreeobject to false to not render it at all
Bedrock components can be written as pure Pug (and thus render as pure HTML), but sometimes rely on Pug mixins to provide a way to encapsulate logic and attributes without tying the code to a specific JS framework or backend environment.
See this blog post for more details.
Bedrock provides some flags to minify CSS and JS, see configuration.
When you run Bedrock using
npm start (i.e. in development mode) you will see that files get written to a folder called
tmp. This is useful to inspect the output while developing. For example you can inspect how large your JS bundle is getting.
When you run
npm run build, a full static site gets generated. In the
dist folder you will find files you can deploy as a static website.
In the folder you will see a file called
It is unnecessary to load this file when moving the prototype code to another dev environment (e.g. a JS view framework like Vue; a PHP environment, etc.). You can delete this file in this case.
We recommend deleting it as well as deleting