build
Last updated
Was this helpful?
Last updated
Was this helpful?
Builds the project for production.
The command will use the files generated by this frontity build
command.
[options]
Option
Description
--help
Output usage information
Examples
Builds the project for production using an external domain https://external-domain.com/static
as the path for static files
--development
optionThis flag correspond to so it will run webpack in the development mode as described .
For example, when running react in development mode (when process.env.NODE_ENV
is set to development
and NOT to production
) you get from React but at the cost of slower performance.
So, it’s basically the same as just running frontity dev
except that it will only build the project once
and will not run the development server.
--target
optionThe target option allows to decide what features will be transpiled with babel.
With --target es5
, the support of the following browsers as the minimum is:
--public-path
optionBy default Frontity will look for static assets in the path <YOUR-DOMAIN>/static
With the --public-path
option 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
.
Example:
FRONTITY_BUILD_TARGET
Create bundles with es5
, module
or both
. Default target is both
.
Example:
FRONTITY_BUILD_DEVELOPMENT
Frontity by default builds the server in "production mode". Setting this variable makes it run in "development mode" (with disabled optimizations, etc.)
Example:
FRONTITY_BUILD_PUBLIC_PATH
Set the public path for static assets. Default path is /static/
.
Example:
Builds the project for development. Related environment variable:
Builds the project. Create bundles with "es5", "module" or "both". Default target is "both". Related environment variable:
Set the for static assets. Default path is "/static/". Related environment variable:
So, Frontity don't transpile any features that those browsers already support. In particular Frontity aim to support only the browsers that ship with the . This list comes from and it is to determine how to transpile the files.
With --target module
, Frontity tell babel to
The and cannot be changed after that.
This option is also available for command
If detected, and no --target
option is defined for Frontity command, this environment variable will be applied.
If detected, and no flag is defined for Frontity command, this environment variable value will be applied.