@nauto/web-apps-archetype
v2.1.1
Published
Builder archetype for Nauto's frontend applications
Downloads
7
Maintainers
Keywords
Readme
Web Apps Archetype
This package contains the builder archetype for Nauto's web applications.
Scripts
The following scripts are provided by the archetype and are meant to provide sensible defaults for development workflows on our web applications. They leverage a project's local tsconfig.json
and tslint.json
to determine which files are relevant for a particular script.
ENV variables
We're using webpack to inject some global variables to be used by both your application and by your build tooling:
process.env.NODE_ENV
- Is set to 'development' if unspecified or using
NODE_ENV=development
, and to 'production' otherwise.
- Is set to 'development' if unspecified or using
process.env.APP_ENV
- Is set to the value of
NODE_ENV
- e.g. in
NODE_ENV=staging ne builder build
,process.env.APP_ENV
will be 'staging', andprocess.env.NODE_ENV
will be 'production'
- Is set to the value of
start
Runs a webpack
dev server with hot module reloading using the archetypal webpack configuration.
build
Runs webpack
with the archetypal webpack configuration. Outputs to the dist/
folder. Minimizes, splits code, and generates source maps. In order to build for a particular environment, you'll need to set NODE_ENV appropriately:
NODE_ENV=production ne builder run build
server
Runs an express server serving static files from dist/
; typically used with the build
script to serve its output.
lint
Runs tslint
against the files specified in your local tsconfig.json
test
Runs jest
with the archetypal configuration.
Examples
The following examples can be run from within a project using builder
and this archetype:
# list all available scripts
ne builder
# run an archetypal script
# (behavior can be overridden with a local script of the same name)
ne builder run <script-name>
Publishing to NPM
Publishing is done via scripts in the root; see the relevant section of the README.
Technology
- Node 8
- Yarn
- Typescript 2.7
- Webpack 3
- React 16
- React-Router 4
- Redux
- Styled-components
- Jest
- Cypress