packaton 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/app-prod.js +2 -2
- package/src/config.js +1 -0
- package/src/reportSizes.js +1 -1
package/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/app-prod.js
CHANGED
|
@@ -54,7 +54,7 @@ export async function buildStaticPages(config) {
|
|
|
54
54
|
// TODO remap media in css and js
|
|
55
55
|
await doc.inlineMinifiedCSS()
|
|
56
56
|
await doc.inlineMinifiedJS()
|
|
57
|
-
write(pDist + route, doc.html)
|
|
57
|
+
write(pDist + route + config.outputExtension, doc.html)
|
|
58
58
|
cspByRoute.push([route, doc.csp()])
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -68,7 +68,7 @@ export async function buildStaticPages(config) {
|
|
|
68
68
|
write(pDistCspNginxMap, cspByRoute.map(([route, csp]) =>
|
|
69
69
|
`${route} "${csp}";`).join('\n'))
|
|
70
70
|
|
|
71
|
-
reportSizes(pSizesReport, pDist, docs.routes)
|
|
71
|
+
reportSizes(pSizesReport, pDist, docs.routes.map(f => f + config.outputExtension))
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
74
|
reject(error)
|
package/src/config.js
CHANGED
|
@@ -26,6 +26,7 @@ const schema = {
|
|
|
26
26
|
hotReload: [true, is(Boolean)],
|
|
27
27
|
|
|
28
28
|
// Production
|
|
29
|
+
outputExtension: ['.html', optional(String)],
|
|
29
30
|
outputPath: ['dist', optional(String)], // TODO resolve
|
|
30
31
|
minifyJS: [minifyJS, optional(Function)],
|
|
31
32
|
minifyCSS: [minifyCSS, optional(Function)],
|
package/src/reportSizes.js
CHANGED
|
@@ -3,7 +3,7 @@ import { read, sizeOf, sha1, saveAsJSON, isFile } from './fs-utils.js'
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export function reportSizes(reportFilename, baseDir, files) {
|
|
6
|
-
const oldReport = isFile(reportFilename)
|
|
6
|
+
const oldReport = isFile(reportFilename)
|
|
7
7
|
? JSON.parse(read(reportFilename))
|
|
8
8
|
: {}
|
|
9
9
|
const newReport = {}
|