Skip to content

[No JIRA]SplitChunks remove name and SubresourceIntegrityPlugin use new import syntax#146

Merged
paul-tan (paultan2021) merged 6 commits into
fork_cra5from
update-splitchunks-srienabled
May 13, 2022
Merged

[No JIRA]SplitChunks remove name and SubresourceIntegrityPlugin use new import syntax#146
paul-tan (paultan2021) merged 6 commits into
fork_cra5from
update-splitchunks-srienabled

Conversation

@salleyliu

Copy link
Copy Markdown

Splitchunks: in webpack5, optimization.splitChunks name: true removed: Automatic names are no longer supported, see here.
sriEnabled: migrate v1 to v5 use new import syntax, see here.

change files:

  • splitChunks: remove name when development is ture
  • sirEnabled: change const SubresourceIntegrityPlugin = require("webpack-subresource-integrity"); to const { SubresourceIntegrityPlugin } = require("webpack-subresource-integrity")

@salleyliu salleyliu (salleyliu) changed the title [No JIRA]Modify splitChunks and sriEnabled [No JIRA]splitChunks remove name and SubresourceIntegrityPlugin use new import syntax May 10, 2022
@salleyliu salleyliu (salleyliu) changed the title [No JIRA]splitChunks remove name and SubresourceIntegrityPlugin use new import syntax [No JIRA]SplitChunks remove name and SubresourceIntegrityPlugin use new import syntax May 10, 2022

@jaysonwu991 Jayson Wu (jaysonwu991) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Glad that SplitChunk issue has been solved, here it only needs small changes.

: {},
}
: {},
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good to use some common code to implement this functionality, no need to have a deep structure of code.

const bpkReactScriptsConfig = appPackageJson['backpack-react-scripts'] || {};

module.exports = (isEnvDevelopment) => {
module.exports = isEnvDevelopment => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this formation changed by husky hooks when executing git commands?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is due to formatting the document, and I will restore it.

Comment thread packages/react-scripts/backpack-addons/sriEnabled.js
"use strict";

const SubresourceIntegrityPlugin = require("webpack-subresource-integrity");
const { SubresourceIntegrityPlugin } = require("webpack-subresource-integrity");

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Migrate v1 to v5 use new import syntax, see here.

}
: {
...chunksAndGroups,
name: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what is the chunk name looks like for both the name: false and without name case?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

when name is false:
image

when without name:
image
So the chunk name is the same when the name: false and without name.

@paultan2021 paul-tan (paultan2021) merged commit 2c3ded8 into fork_cra5 May 13, 2022
@olliecurtis Ollie Curtis (olliecurtis) deleted the update-splitchunks-srienabled branch October 10, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants