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",
"mg-crud": "^1.1.2",
"npm": "^5.10.0",
"object-diff": "0.0.4",
"object.pick": "^1.3.0",
"oclazyload": "^0.6.3",
"require-yaml": "0.0.1",
"validator": "^6.2.1"

View File

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

View File

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

View File

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

View File

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