Fix empty WebUI static assets directory
This commit is contained in:
parent
6974f54bfd
commit
fb23bd5d26
11 changed files with 27 additions and 19 deletions
4
webui/.gitignore
vendored
4
webui/.gitignore
vendored
|
@ -26,3 +26,7 @@ yarn-error.log*
|
|||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# static assets (ignore all except the DO NOT EDIT file)
|
||||
static/*
|
||||
!static/DONT-EDIT-FILES-IN-THIS-DIRECTORY.md
|
||||
|
|
|
@ -5,6 +5,7 @@ const folder = process.argv[2]
|
|||
async function execute () {
|
||||
try {
|
||||
await fs.emptyDir('./static')
|
||||
await fs.outputFile('./static/DONT-EDIT-FILES-IN-THIS-DIRECTORY.md', 'For more information show `webui/readme.md`')
|
||||
console.log('Deleted static folder contents!')
|
||||
await fs.copy(`./dist/${folder}`, './static', { overwrite: true })
|
||||
console.log('Installed new files in static folder!')
|
||||
|
|
|
@ -14,15 +14,15 @@ Traefik Web UI provide 2 types of information:
|
|||
Use the make file :
|
||||
|
||||
```shell
|
||||
make build-image # Generate Docker image
|
||||
make generate-webui # Generate static contents in `traefik/webui/static/` folder.
|
||||
make build-image # Generate Docker image.
|
||||
make clean-webui generate-webui # Generate static contents in `webui/static/` folder.
|
||||
```
|
||||
|
||||
## How to build (only for frontend developer)
|
||||
|
||||
- prerequisite: [Node 12.11+](https://nodejs.org) [Npm](https://www.npmjs.com/)
|
||||
|
||||
- Go to the `webui` directory
|
||||
- Go to the `webui/` directory
|
||||
|
||||
- To install dependencies, execute the following commands:
|
||||
|
||||
|
@ -32,9 +32,9 @@ make generate-webui # Generate static contents in `traefik/webui/static/` fold
|
|||
|
||||
- `npm run build`
|
||||
|
||||
- Static contents are built in the `webui/static` directory
|
||||
- Static contents are built in the `webui/static/` directory
|
||||
|
||||
**Do not manually change the files in the `webui/static` directory**
|
||||
**Do not manually change the files in the `webui/static/` directory**
|
||||
|
||||
- The build allows to:
|
||||
- optimize all JavaScript
|
||||
|
@ -46,10 +46,10 @@ make generate-webui # Generate static contents in `traefik/webui/static/` fold
|
|||
|
||||
## How to edit (only for frontend developer)
|
||||
|
||||
**Do not manually change the files in the `webui/static` directory**
|
||||
**Do not manually change the files in the `webui/static/` directory**
|
||||
|
||||
- Go to the `webui` directory
|
||||
- Edit files in `webui/src`
|
||||
- Go to the `webui/` directory
|
||||
- Edit files in `webui/src/`
|
||||
- Run in development mode :
|
||||
- `npm run dev`
|
||||
|
||||
|
|
1
webui/static/DONT-EDIT-FILES-IN-THIS-DIRECTORY.md
Normal file
1
webui/static/DONT-EDIT-FILES-IN-THIS-DIRECTORY.md
Normal file
|
@ -0,0 +1 @@
|
|||
For more information show `webui/readme.md`
|
Loading…
Add table
Add a link
Reference in a new issue