added build version for route caching & package fix #448

This commit is contained in:
Joan Sanchez 2018-09-25 11:44:21 +02:00
parent 0777eddf54
commit cef2d91c9c
5 changed files with 9 additions and 6 deletions

View File

@ -21,8 +21,6 @@
"material-design-lite": "^1.3.0", "material-design-lite": "^1.3.0",
"mg-crud": "^1.1.2", "mg-crud": "^1.1.2",
"npm": "^5.10.0", "npm": "^5.10.0",
"object-diff": "0.0.4",
"object.pick": "^1.3.0",
"oclazyload": "^0.6.3", "oclazyload": "^0.6.3",
"require-yaml": "0.0.1", "require-yaml": "0.0.1",
"validator": "^6.2.1" "validator": "^6.2.1"

View File

@ -1,5 +1,5 @@
FROM vn-loopback:latest FROM vn-loopback:latest
COPY route /app COPY agency /app
WORKDIR /app WORKDIR /app
CMD ["pm2-docker", "./server/server.js"] CMD ["pm2-docker", "./server/server.js"]

View File

@ -8,7 +8,9 @@
"posttest": "npm run lint && nsp check" "posttest": "npm run lint && nsp check"
}, },
"dependencies": { "dependencies": {
"vn-loopback": "file:../loopback" "vn-loopback": "file:../loopback",
"object-diff": "0.0.4",
"object.pick": "^1.3.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -53,9 +53,12 @@ function vnBoot(app, rootDir, rootModule) {
app.use(loopback.static(path.resolve(rootDir, '../client'))); app.use(loopback.static(path.resolve(rootDir, '../client')));
} }
const buildVersion = new Date().getTime();
app.renderIndex = async res => { app.renderIndex = async res => {
res.render(`${viewDir}/index.ejs`, { res.render(`${viewDir}/index.ejs`, {
assets: assets assets: assets,
version: buildVersion
}); });
function assets(main, deps) { function assets(main, deps) {

View File

@ -8,7 +8,7 @@
<body> <body>
<vn-app></vn-app> <vn-app></vn-app>
<script type="text/javascript" <script type="text/javascript"
src="/static/routes.js"> src="/static/routes.js?<%= version %>">
</script> </script>
<% for (let jsFile of assets('salix', ['vendor'])) { %> <% for (let jsFile of assets('salix', ['vendor'])) { %>
<script type="text/javascript" src="<%= jsFile %>"></script> <script type="text/javascript" src="<%= jsFile %>"></script>