Skip to content

Commit

Permalink
fix: json import should now use with instead of assert
Browse files Browse the repository at this point in the history
  • Loading branch information
apostolos committed May 26, 2024
1 parent dca9c56 commit ee2f0db
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/post-production.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import prettyBytes from './lib/prettyBytes.mjs';
import formatSize from './lib/formatSize.mjs';
import ellipsis from './lib/ellipsis.mjs';

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

/*
POST PRODUCTION:
Expand Down Expand Up @@ -94,7 +94,10 @@ for (let chunkName of Object.keys(manifest.namedChunkGroups)) {
}

// Store production manifest
await writeFile(path.resolve(import.meta.dirname, '../public/manifest.json'), JSON.stringify(productionManifest, null, 2));
await writeFile(
path.resolve(import.meta.dirname, '../public/manifest.json'),
JSON.stringify(productionManifest, null, 2),
);

/*
// Generate Service Worker
Expand All @@ -113,7 +116,10 @@ const terserConfig = JSON.parse(await readFile(path.resolve(import.meta.dirname,
sw = (await minify(sw, terserConfig)).code;
await writeFile(path.resolve(import.meta.dirname, '../public/sw.js'), sw, { encoding: 'utf-8' });
*/
await copyFile(path.resolve(import.meta.dirname, '../client/sw-destroy.js'), path.resolve(import.meta.dirname, '../public/sw.js'));
await copyFile(
path.resolve(import.meta.dirname, '../client/sw-destroy.js'),
path.resolve(import.meta.dirname, '../public/sw.js'),
);

// Print file report
let sum = 0;
Expand Down

0 comments on commit ee2f0db

Please sign in to comment.