Skip to content

Commit

Permalink
feat: upgrade webpack 5 to 5.35.1 and hook webpack/lib/Chunk (#6494)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Apr 27, 2021
1 parent 05de48d commit 66fe6ab
Show file tree
Hide file tree
Showing 10 changed files with 1,199 additions and 559 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"commit-msg": "node scripts/verifyCommit.js"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"*.{jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
Expand Down
1 change: 1 addition & 0 deletions packages/bundler-webpack/src/requireHook.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const files = [
'webpack/lib/Chunk',
'webpack/lib/Compilation',
'webpack/lib/dependencies/ConstDependency',
'webpack/lib/javascript/JavascriptParserHelpers',
Expand Down
1 change: 1 addition & 0 deletions packages/deps/bundles/webpack/bundle4.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = function () {
return {
// inner imports
Chunk: require('webpack/lib/Chunk'),
Compilation: require('webpack/lib/Compilation'),
ConstDependency: require('webpack/lib/dependencies/ConstDependency'),
ExternalsPlugin: require('webpack/lib/ExternalsPlugin'),
Expand Down
1 change: 1 addition & 0 deletions packages/deps/bundles/webpack/bundle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = function () {
return {
// inner imports
Chunk: require('webpack5/lib/Chunk'),
Compilation: require('webpack5/lib/Compilation'),
ConstDependency: require('webpack5/lib/dependencies/ConstDependency'),
ExternalsPlugin: require('webpack5/lib/ExternalsPlugin'),
Expand Down
1 change: 1 addition & 0 deletions packages/deps/bundles/webpack/innerFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { writeFileSync } = require('fs');
const { join } = require('path');

const files = [
'webpack/lib/Chunk',
'webpack/lib/Compilation',
'webpack/lib/dependencies/ConstDependency',
'webpack/lib/ExternalsPlugin',
Expand Down
1 change: 1 addition & 0 deletions packages/deps/bundles/webpack/packages/Chunk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').Chunk;
5 changes: 5 additions & 0 deletions packages/deps/compiled/webpack/4/bundle4.js
Original file line number Diff line number Diff line change
Expand Up @@ -76803,6 +76803,10 @@ module.exports = function isExtendable(val) {


module.exports = function repeat(ele, num) {
if (Array.prototype.fill) {
return new Array(num).fill(ele);
}

var arr = new Array(num);

for (var i = 0; i < num; i++) {
Expand Down Expand Up @@ -154856,6 +154860,7 @@ defineExport("CompatSource", () => __webpack_require__(47183));
module.exports = function () {
return {
// inner imports
Chunk: __webpack_require__(54029),
Compilation: __webpack_require__(46587),
ConstDependency: __webpack_require__(53119),
ExternalsPlugin: __webpack_require__(2170),
Expand Down

0 comments on commit 66fe6ab

Please sign in to comment.