Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
May 13, 2022

Conversation

salleyliu
Copy link

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 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 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
Copy link

@jaysonwu991 jaysonwu991 left a comment

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.

: {},
}
: {},
};

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.

@@ -4,23 +4,34 @@ const paths = require('../config/paths');
const appPackageJson = require(paths.appPackageJson);
const bpkReactScriptsConfig = appPackageJson['backpack-react-scripts'] || {};

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

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
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.

@@ -1,6 +1,6 @@
"use strict";

const SubresourceIntegrityPlugin = require("webpack-subresource-integrity");
const { SubresourceIntegrityPlugin } = require("webpack-subresource-integrity");
Copy link
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,

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
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 paultan2021 merged commit 2c3ded8 into fork_cra5 May 13, 2022
@olliecurtis 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