Skip to content

Commit

Permalink
Add missing "await" on minify call. Fixes terser#9.
Browse files Browse the repository at this point in the history
  • Loading branch information
casieber committed Aug 6, 2020
1 parent eda345f commit 3cb9228
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ class Repl extends Component {
DEBOUNCE_DELAY
);

_minify = (code, setStateCallback) => {
_minify = async (code, setStateCallback) => {
// we need to clone this because terser mutates the options object :(
const terserOpts = cloneDeep(this.state.terserOptions);

// TODO: put this in a worker to avoid blocking the UI on heavy content
try {
const result = this.props.terser.minify(code, terserOpts);
const result = await this.props.terser.minify(code, terserOpts);

if (result.error) {
this.setState({ errorMessage: result.error.message });
Expand Down

0 comments on commit 3cb9228

Please sign in to comment.