CSS static resources url to file path mappings

master
Yohany Flores Suarez 5 years ago committed by Quentin McGaw
parent 86a7b08512
commit a90e2f2b1a

@ -21,6 +21,7 @@ RUN wget -q https://github.com/benweet/stackedit/archive/${STACKEDIT_VERSION}.ta
RUN npm install RUN npm install
RUN npm audit fix RUN npm audit fix
ENV NODE_ENV=production ENV NODE_ENV=production
RUN sed -i "s/assetsPublicPath: '\/',/assetsPublicPath: '.\/',/g" config/index.js && cat config/index.js
RUN npm run build RUN npm run build
FROM scratch AS final FROM scratch AS final

@ -62,9 +62,13 @@ func main() {
case "/oauth2/callback": case "/oauth2/callback":
filepath = "/static/oauth2/callback.html" filepath = "/static/oauth2/callback.html"
case "/app", "/app/": case "/app", "/app/":
filepath = "/dist/" filepath = "/dist/index.html"
default: default:
switch { switch {
case strings.HasPrefix(urlStackeditPath, "/static/css/static/fonts/"):
filepath = "/dist/" + strings.TrimPrefix(urlStackeditPath, "/static/css/")
case strings.HasPrefix(urlStackeditPath, "/app/static/css/static/fonts/"):
filepath = "/dist/" + strings.TrimPrefix(urlStackeditPath, "/app/static/css/")
case strings.HasPrefix(urlStackeditPath, "/app/"): case strings.HasPrefix(urlStackeditPath, "/app/"):
filepath = "/dist/" + strings.TrimPrefix(urlStackeditPath, "/app/") filepath = "/dist/" + strings.TrimPrefix(urlStackeditPath, "/app/")
} }

Loading…
Cancel
Save