Skip to content

Commit ee2f0db

Browse files
committed
fix: json import should now use with instead of assert
1 parent dca9c56 commit ee2f0db

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/post-production.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import prettyBytes from './lib/prettyBytes.mjs';
1010
import formatSize from './lib/formatSize.mjs';
1111
import ellipsis from './lib/ellipsis.mjs';
1212

13-
import manifest from '../public/js/webpack.manifest.json' assert { type: 'json' };
13+
import manifest from '../public/js/webpack.manifest.json' with { type: 'json' };
1414

1515
/*
1616
POST PRODUCTION:
@@ -94,7 +94,10 @@ for (let chunkName of Object.keys(manifest.namedChunkGroups)) {
9494
}
9595

9696
// Store production manifest
97-
await writeFile(path.resolve(import.meta.dirname, '../public/manifest.json'), JSON.stringify(productionManifest, null, 2));
97+
await writeFile(
98+
path.resolve(import.meta.dirname, '../public/manifest.json'),
99+
JSON.stringify(productionManifest, null, 2),
100+
);
98101

99102
/*
100103
// Generate Service Worker
@@ -113,7 +116,10 @@ const terserConfig = JSON.parse(await readFile(path.resolve(import.meta.dirname,
113116
sw = (await minify(sw, terserConfig)).code;
114117
await writeFile(path.resolve(import.meta.dirname, '../public/sw.js'), sw, { encoding: 'utf-8' });
115118
*/
116-
await copyFile(path.resolve(import.meta.dirname, '../client/sw-destroy.js'), path.resolve(import.meta.dirname, '../public/sw.js'));
119+
await copyFile(
120+
path.resolve(import.meta.dirname, '../client/sw-destroy.js'),
121+
path.resolve(import.meta.dirname, '../public/sw.js'),
122+
);
117123

118124
// Print file report
119125
let sum = 0;

0 commit comments

Comments
 (0)