Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugin.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const { spawn } = require('child_process');
const fs = require('fs');
const util = require("util");
const path = require('path');
const commandExistsSync = require('command-exists').sync;
const chalk = require('chalk');
const Watchpack = require('watchpack');
const which = require('which');
const { homedir } = require('os');

const stat = util.promisify(fs.stat);

const error = msg => console.error(chalk.bold.red(msg));
let info = msg => console.log(chalk.bold.blue(msg));

Expand Down Expand Up @@ -150,7 +153,7 @@ class WasmPackPlugin {
_compile(watching) {
info(`ℹ️ Compiling your crate in ${this.isDebug ? 'development' : 'release'} mode...\n`);

return fs.promises.stat(this.crateDirectory).then(stats => {
return stat(this.crateDirectory).then(stats => {
if (!stats.isDirectory()) {
throw new Error(`${this.crateDirectory} is not a directory`);
}
Expand Down