Skip to content

Commit

Permalink
Format entire codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jihchi committed Jul 2, 2022
1 parent e29cda0 commit 8667794
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@types/debug": "^4.1.7",
"prettier": "^2.7.1",
"prettier": "2.7.1",
"tsup": "^6.1.3",
"vite": "^2.5.3",
"vitest": "^0.1.16"
Expand Down
16 changes: 9 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function launchReScript(watch: boolean) {
stderr && stderr.on('data', dataListener);

if (watch) {
await new Promise(resolve => {
await new Promise((resolve) => {
compileOnce = resolve;
});
} else {
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function createReScriptPlugin(config?: Config): Plugin {
);
}
},
config: userConfig => ({
config: (userConfig) => ({
build: {
// If the build watcher is enabled (adding watch config would automatically enable it),
// exclude rescript files since recompilation should be based on the generated JS files.
Expand All @@ -99,11 +99,13 @@ export default function createReScriptPlugin(config?: Config): Plugin {
configureServer(server) {
// Manually find and parse log file after server start since
// initial compilation does not trigger handleHotUpdate.
fs.readFile(path.resolve('./lib/bs/.compiler.log'), 'utf8').then(data => {
const log = data.toString();
const err = parseCompilerLog(log);
if (err) server.ws.send({ type: 'error', err });
});
fs.readFile(path.resolve('./lib/bs/.compiler.log'), 'utf8').then(
(data) => {
const log = data.toString();
const err = parseCompilerLog(log);
if (err) server.ws.send({ type: 'error', err });
}
);
},
// Hook that resolves `.bs.js` imports to their `.res` counterpart
async resolveId(source, importer, options: any) {
Expand Down

0 comments on commit 8667794

Please sign in to comment.