Skip to content

Commit

Permalink
fix(rollup): do not log quotes around NODE_ENV (#9533)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
christopherthielen and mergify[bot] committed Jul 28, 2021
1 parent 14fa364 commit 7bcf7d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/scripts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
'no-console': 'off',
},
};
6 changes: 3 additions & 3 deletions packages/scripts/config/rollup.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const { visualizer } = require('rollup-plugin-visualizer');

const ROLLUP_STATS = !!process.env.ROLLUP_STATS;
const ROLLUP_WATCH = !!process.env.ROLLUP_WATCH;
const NODE_ENV = JSON.stringify(process.env.NODE_ENV || 'development');
const NODE_ENV = process.env.NODE_ENV || 'development';
const ENV_MINIFY = process.env.ROLLUP_MINIFY;
const ROLLUP_MINIFY = ENV_MINIFY === 'true' || (NODE_ENV === '"production"' && ENV_MINIFY !== 'false');
const ROLLUP_MINIFY = ENV_MINIFY === 'true' || (NODE_ENV === 'production' && ENV_MINIFY !== 'false');

// eslint-disable-next-line no-console
console.log({ ROLLUP_STATS, ROLLUP_WATCH, ROLLUP_MINIFY, NODE_ENV });
Expand All @@ -35,7 +35,7 @@ const plugins = [
// Replace literal string 'process.env.NODE_ENV' with the current NODE_ENV
replace({
preventAssignment: true,
values: { 'process.env.NODE_ENV': NODE_ENV },
values: { 'process.env.NODE_ENV': `"${NODE_ENV}"` },
}),
esbuild({
sourcemap: true,
Expand Down

0 comments on commit 7bcf7d7

Please sign in to comment.