Skip to content

Commit

Permalink
fix(vite): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
committed Dec 13, 2022
1 parent 9b16d20 commit e3396d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite/plugins/rollup-replace-files.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function replaceFiles(replacements: FileReplacement[]) {
return {
name: 'rollup-plugin-replace-files',
enforce: 'pre',
async transform (code, id) {
async transform(code, id) {
/**
* The reason we're using endsWith here is because the resolved id
* will be the absolute path to the file. We want to check if the
Expand All @@ -32,7 +32,9 @@ export default function replaceFiles(replacements: FileReplacement[]) {
);
try {
// return new file content
return fs.readFileSync(id.replace(foundReplace.replace, foundReplace.with)).toString();
return fs
.readFileSync(id.replace(foundReplace.replace, foundReplace.with))
.toString();
} catch (err) {
console.error(err);
return code;
Expand Down

0 comments on commit e3396d5

Please sign in to comment.