Skip to content

Commit

Permalink
fix: styles missing, error not shown
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Aug 23, 2024
1 parent e32f735 commit 72a4806
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"bugs": "https://github.com/AriPerkkio/vite-plugin-source-map-visualizer",
"repository": "https://github.com/AriPerkkio/vite-plugin-source-map-visualizer",
"scripts": {
"build": "rm -rf ./dist && tsc --project tsconfig.build.json",
"build": "rm -rf ./dist && tsc --project tsconfig.build.json && cp src/*.css dist",
"test": "vitest --coverage",
"typecheck": "tsc --noEmit"
},
Expand Down
11 changes: 8 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ export function sourcemapVisualizer(options?: Options): Plugin {
},

async buildEnd() {
const filename = `${outDir}/${reportName}`;
const html = generateHTML(results, filename);
await fs.writeFile(filename, html, "utf8");
try {
const filename = `${outDir}/${reportName}`;
const html = generateHTML(results, filename);
await fs.writeFile(filename, html, "utf8");
} catch (error) {
console.error(error);
throw error;
}
},
};
}
Expand Down

0 comments on commit 72a4806

Please sign in to comment.