Skip to content

Commit

Permalink
add new logger warning when both minBundleSize and disableSharedBundl…
Browse files Browse the repository at this point in the history
…es are manually set
  • Loading branch information
achan3 committed Aug 22, 2023
1 parent cbce809 commit fd2cdaa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions packages/bundlers/default/src/DefaultBundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import invariant from 'assert';
import {ALL_EDGE_TYPES} from '@parcel/graph';
import {Bundler} from '@parcel/plugin';
import {setEqual, validateSchema, DefaultMap, BitSet} from '@parcel/utils';
import logger from '@parcel/logger';
import nullthrows from 'nullthrows';
import {encodeJSONKeyComponent} from '@parcel/diagnostic';

Expand Down Expand Up @@ -1369,6 +1370,17 @@ async function loadBundlerConfig(

invariant(conf?.contents != null);

// minBundles value will be ignored if shared bundles are disabled
if (
conf.contents.minBundleSize != null &&
conf.contents.disableSharedBundles === true
) {
logger.warn({
origin: '@parcel/bundler-default',
message: `The value of "${conf.contents.minBundleSize}" set for minBundleSize will not be used as shared bundles have been disabled`,
});
}

validateSchema.diagnostic(
CONFIG_SCHEMA,
{
Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "git",
"url": "https://github.com/parcel-bundler/parcel.git"
},
"bin": "src/bin.js",
"bin": "lib/bin.js",
"main": "lib/bin.js",
"source": "src/bin.js",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@parcel/create-react-app",
"version": "2.9.3",
"bin": {
"parcel-create-react-app": "src/bin.js"
"parcel-create-react-app": "lib/bin.js"
},
"main": "src/bin.js",
"repository": {
Expand Down

0 comments on commit fd2cdaa

Please sign in to comment.