Skip to content

Commit

Permalink
Add a warning if you forget to install @babel/core or install babel-c…
Browse files Browse the repository at this point in the history
…ore.
  • Loading branch information
loganfsmyth committed Sep 1, 2018
1 parent a55fc2e commit 7b32e0c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
const babel = require("@babel/core");
let babel;
try {
babel = require("@babel/core");
} catch (err) {
if (err.code === "MODULE_NOT_FOUND") {
err.message +=
"\n babel-loader@8 requires Babel 7.x (the package '@babel/core'). " +
"If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.";
}
throw err;
}

const pkg = require("../package.json");
const cache = require("./cache");
Expand Down

0 comments on commit 7b32e0c

Please sign in to comment.