Skip to content

Commit

Permalink
fix(dev): Hide Babel spam (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
zetlen authored and jimbo committed Feb 12, 2019
1 parent e4568a8 commit 3c22779
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
18 changes: 6 additions & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const browsers = require('./browserslist');
const chalk = require('chalk');
const { resolvePath } = require('babel-plugin-module-resolver');

const plugins = [
['@babel/plugin-proposal-class-properties'],
Expand All @@ -16,17 +16,7 @@ const targets = {
test: 'node 10'
};

let warned = false;

const config = api => {
if (process.env.WARN_RESOLVE) {
warned = true;
console.warn(
chalk.bold.yellowBright(
'You may see some warnings that @magento/venia-drivers could not be resolved. This is normal and not an error; Venia exports a virtual import path and babel-plugin-module-resolver is hardcoded to warn about it.'
)
);
}
const envConfigs = {
/**
* Watch mode and build:esm partial transpilation mode.
Expand Down Expand Up @@ -65,7 +55,11 @@ const config = api => {
*/
alias: {
'^src/drivers$': '@magento/venia-drivers'
}
},
/**
* Suppress console warning about missing dependencies.
*/
loglevel: 'silent'
}
]
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@magento/eslint-config": "~1.3.0",
"babel-eslint": "~10.0.1",
"babel-plugin-module-resolver": "~3.1.3",
"babel-plugin-module-resolver": "~3.2.0",
"bundlesize": "~0.17.1",
"chalk": "~2.4.2",
"chokidar": "~2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "yarn run clean && yarn run build:esm && yarn run validate-queries && yarn run build:prod",
"build:analyze": "yarn run clean && mkdir dist && yarn run validate-queries && yarn run build:stats",
"build:dev": "echo 'Skipping venia-concept build...'",
"build:esm": "BABEL_ENV=development WARN_RESOLVE=1 babel src --out-dir esm --root-mode 'upward' --source-maps --copy-files",
"build:esm": "BABEL_ENV=development babel src --out-dir esm --root-mode 'upward' --source-maps --copy-files",
"build:prod": "webpack -p --color --progress --profile --env.mode production",
"clean": "rimraf dist esm",
"prepublishOnly": "yarn run build",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3538,10 +3538,10 @@ babel-plugin-minify-type-constructors@^0.4.3:
dependencies:
babel-helper-is-void-0 "^0.4.3"

babel-plugin-module-resolver@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.1.3.tgz#5a1c148bf528d20907ed508b70ae3c4762e78c8d"
integrity sha512-QRfA8b2H7l9uSElLwS0rHoPhjPhgpncKUvrn42tJpdCoJ3IS6J+m4mp5FtnRoXHry3ZYJ2SMLLG/REikQA6tjg==
babel-plugin-module-resolver@~3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.2.0.tgz#ddfa5e301e3b9aa12d852a9979f18b37881ff5a7"
integrity sha512-tjR0GvSndzPew/Iayf4uICWZqjBwnlMWjSx6brryfQ81F9rxBVqwDJtFCV8oOs0+vJeefK9TmdZtkIFdFe1UnA==
dependencies:
find-babel-config "^1.1.0"
glob "^7.1.2"
Expand Down

1 comment on commit 3c22779

@vercel
Copy link

@vercel vercel bot commented on 3c22779 Feb 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aliasing failed with the following error:

Error! Instance verification timed out (3m)

Please sign in to comment.