# Scripts
The entry points to run commands to dev, buid or deploy the Nuxt app are:
- file package.json for Javascript scripts
- folder python/scripts for Python scripts
# Javascript
The following commands can be run in the nuxt-dashboard-template repo top folder.
(where file package.json is)
yarn cdn- Launch server for files in folder
cdn/ - Keep this command running while developing.
- Launch server for files in folder
yarn lint- Run linter to check for errors in source code.
- Run every now and then. Most likely your editor does it too.
yarn lintfix- Run linter to check for errors in source code and fix what can be automatically.
- Run every now and then.
dump-conf-[f]- Dump webpack config produced by Nuxt to file
nuxt-webpack-config-dump.json. - Launch
nuxt devand stop after dump.
- Dump webpack config produced by Nuxt to file
yarn dev-[f]- Launch
nuxt devserver, with hot reload. - Keep this command running while developping.
- Launch
yarn dev-debug-[f]- Launch
nuxt devserver in debug mode. - See the Debug section for the debug workflow with VS Code.
- Launch
yarn build-dir-local-[f]- Launch
nuxt buildwith router base =/. - It creates folder
dist/which can be served from/. - It must be followed by script
serve_dir_dir.pyoryarn start.
- Launch
yarn build-sf-local-[f]- Launch
nuxt buildwith router base =/. - This command only create
dist/. - It must be followed by script
build_single_file.pyandserve_dir_template.py.
- Launch
yarn build-sf-[f]- Launch
nuxt buildwith router base =/[SF_SHORTNAME]/. - This command only create
dist/. - It must be followed by script
build_single_file.pyand a deployment to a web server under/[SF_SHORTNAME]/.
- Launch
yarn build-ghp-[f]- Launch
nuxt buildwith router base =/[GH_REPO]/. - This command only create
dist/. - It must be followed by script
deploy-ghp.
- Launch
yarn start- Launch
nuxt startto serve folderdist/from/.
- Launch
yarn deploy-ghp- Copy folder
dist/to repo branchgh-pagesroot. - Results in static site served from
https://oscar6echo.github.io/nuxt-dashboard-template.
- Copy folder
In the scripts above [f] is either:
vfor vuetifybfor bootstrap.
# Python
The following commands are available from the python/scripts.
To run these scripts you must have installed the build_frontend Python package as described in the Get Started section.
- analyze_dist.py
- Displays number of distinct files and content size for
.htmland.jsfiles in folderdist/. - Essentially it enables to check that all
.htmlfiles are identical and quickly view the name and sizes of the.jsfiles.
- Displays number of distinct files and content size for
- build_single_file.py
- Build a single
.htmlfile that contains the app entirely. - This script
- copies files
ìndex.html,app.js,commons.app.js,runtime.jsfrom folderdist/and filefavicon.icofrom folderstatic/to folderpython/workspace/. - merge all these files into a single file
index.htmlsaved in folderpython/template/.
- copies files
- Build a single
- copy_cdn_static_to_dist.py
- Copy all files in
cdn/todist/. - This is useful to make the dashboard companion files available in the case of the app is served from folder
dist/.
- Copy all files in
- select_framework_bootstrap.py
- Deletes folders
components/,layouts/,pages/and replace them by the same named folders located inpython/framework/bootstrap/.
- Deletes folders
- select_framework_vuetify.py
- Deletes folders
components/,layouts/,pages/and replace them by the same named folders located inpython/framework/vuetify/.
- Deletes folders
- serve_dir_dist.py
- Start a web server (
python -m http.server) from folderdist/. - This folder typically contains the product of
nuxt buildand a copy of the files incdn/.
- Start a web server (
- serve_dir_template.py
- Start a web server (
python -m http.server) from folderpython/template/. - This folder should contain the product of
build_single_file.pyand a copy of the files incdn/.
- Start a web server (