# 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 dev
and stop after dump.
- Dump webpack config produced by Nuxt to file
yarn dev-[f]
- Launch
nuxt dev
server, with hot reload. - Keep this command running while developping.
- Launch
yarn dev-debug-[f]
- Launch
nuxt dev
server in debug mode. - See the Debug section for the debug workflow with VS Code.
- Launch
yarn build-dir-local-[f]
- Launch
nuxt build
with router base =/
. - It creates folder
dist/
which can be served from/
. - It must be followed by script
serve_dir_dir.py
oryarn start
.
- Launch
yarn build-sf-local-[f]
- Launch
nuxt build
with router base =/
. - This command only create
dist/
. - It must be followed by script
build_single_file.py
andserve_dir_template.py
.
- Launch
yarn build-sf-[f]
- Launch
nuxt build
with router base =/[SF_SHORTNAME]/
. - This command only create
dist/
. - It must be followed by script
build_single_file.py
and a deployment to a web server under/[SF_SHORTNAME]/
.
- Launch
yarn build-ghp-[f]
- Launch
nuxt build
with router base =/[GH_REPO]/
. - This command only create
dist/
. - It must be followed by script
deploy-ghp
.
- Launch
yarn start
- Launch
nuxt start
to serve folderdist/
from/
.
- Launch
yarn deploy-ghp
- Copy folder
dist/
to repo branchgh-pages
root. - Results in static site served from
https://oscar6echo.github.io/nuxt-dashboard-template
.
- Copy folder
In the scripts above [f]
is either:
v
for vuetifyb
for 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
.html
and.js
files in folderdist/
. - Essentially it enables to check that all
.html
files are identical and quickly view the name and sizes of the.js
files.
- Displays number of distinct files and content size for
- build_single_file.py
- Build a single
.html
file that contains the app entirely. - This script
- copies files
ìndex.html
,app.js
,commons.app.js
,runtime.js
from folderdist/
and filefavicon.ico
from folderstatic/
to folderpython/workspace/
. - merge all these files into a single file
index.html
saved 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 build
and 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.py
and a copy of the files incdn/
.
- Start a web server (