serve assets from memory, use caching

This commit is contained in:
Rich Harris
2017-12-15 17:20:24 -05:00
parent 892b18cf80
commit 80ae909b73
4 changed files with 90 additions and 66 deletions

View File

@@ -13,7 +13,7 @@ module.exports = function create_app(src, dest, routes, options) {
'{}' :
`{ ${route.dynamic.map((part, i) => `${part}: match[${i + 1}]`).join(', ') } }`;
return `{ pattern: ${route.pattern}, params: match => (${params}), load: () => import('${src}/${route.file}') }`
return `{ pattern: ${route.pattern}, params: match => (${params}), load: () => import(/* webpackChunkName: "${route.id}" */ '${src}/${route.file}') }`
})
.join(',\n\t');