Comment on page
Builds the project for production.
npx frontity build [options]
- Builds the project for production using an external domain
https://external-domain.com/staticas the path for static files
npx frontity build --public-path="https://external-domain.com/static"
For example, when running react in development mode (when
process.env.NODE_ENVis set to
developmentand NOT to
production) you get full error messages and warnings from React but at the cost of slower performance.
npx frontity build --development
So, it’s basically the same as just running
frontity devexcept that it will only build the project
onceand will not run the development server.
The target option allows to decide what features will be transpiled with babel.
--target es5, the support of the following browsers as the minimum is:
"and_chr >= 67",
"and_ff >= 18",
"and_uc >= 11.8",
"android >= 67",
"not android <= 4.4.4",
"chrome >= 49",
"edge >= 12",
"firefox >= 18",
"ios_saf >= 10",
"not op_mini all",
"op_mob >= 46",
"opera >= 36",
"safari >= 10",
"samsung >= 5",
By default Frontity will look for static assets in the path
--public-pathoption you can change the path from where you are serving the statics assets (i.e. js chunk files, fonts, images, etc.)
In case some people need to change it (because of constrains in their site architecture) they would need an option to do so just before generating the Frontity bundle with
npx frontity build.
npx frontity build --public-path="/other/folder"
Create bundles with
both. Default target is
Frontity by default builds the server in "production mode". Setting this variable makes it run in "development mode" (with disabled optimizations, etc.)
Set the public path for static assets. Default path is