From 73e0cecdf1172b378a21d259327b5d83c6c776c3 Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Fri, 22 Jan 2021 10:32:25 -0800 Subject: [PATCH] [fix] minor cosmetics for .browserslistrc handling --- packages/xarc-app-dev/src/config/babel/babelrc.ts | 5 ++++- packages/xarc-app-dev/src/lib/dev-tasks.ts | 8 ++++---- samples/subapp2-poc/.browserslistrc | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/xarc-app-dev/src/config/babel/babelrc.ts b/packages/xarc-app-dev/src/config/babel/babelrc.ts index 228a9ca84..5d0b20b4c 100644 --- a/packages/xarc-app-dev/src/config/babel/babelrc.ts +++ b/packages/xarc-app-dev/src/config/babel/babelrc.ts @@ -169,7 +169,10 @@ const target = isNodeTarget ? "node" : babelTarget; const targets = envTargets[target]; if (!isJest) { - console.log(ck`Babel preset-env compile targets: ${JSON.stringify(targets)}`); + const srcMsg = _.isEmpty(targets) ? " (will read from '.browserslistrc')" : ""; + console.log( + ck`Babel preset-env compile targets: ${JSON.stringify(targets)}${srcMsg}` + ); } const useBuiltIns = diff --git a/packages/xarc-app-dev/src/lib/dev-tasks.ts b/packages/xarc-app-dev/src/lib/dev-tasks.ts index c0cfcd772..2205efe8c 100644 --- a/packages/xarc-app-dev/src/lib/dev-tasks.ts +++ b/packages/xarc-app-dev/src/lib/dev-tasks.ts @@ -290,10 +290,10 @@ export function loadXarcDevTasks(xrun, userOptions: XarcOptions = {}) { Fs.writeFileSync( destRcFile, `# Browsers that we support - last 2 versions - ie >= 11 - > 5% - ` +last 2 versions +ie >= 11 +> 5% +` ); logger.info(`Generating ${configRcFile} for you - please commit it.`); } diff --git a/samples/subapp2-poc/.browserslistrc b/samples/subapp2-poc/.browserslistrc index 00df72b0f..d66332951 100644 --- a/samples/subapp2-poc/.browserslistrc +++ b/samples/subapp2-poc/.browserslistrc @@ -1,4 +1,4 @@ # Browsers that we support - last 2 versions - ie >= 11 - > 5% +last 2 versions +ie >= 11 +> 5%