Skip to content

Commit

Permalink
add missing require hooks which are used by test cases
Browse files Browse the repository at this point in the history
This is now visible because `webpack` no longer exists as package in next.js
  • Loading branch information
sokra committed Sep 16, 2021
1 parent 46394a0 commit 471712f
Show file tree
Hide file tree
Showing 19 changed files with 111 additions and 1 deletion.
48 changes: 48 additions & 0 deletions packages/next/build/webpack/require-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,54 @@ const hookPropertyMap = new Map(
'webpack/lib/SingleEntryPlugin.js',
'next/dist/compiled/webpack/SingleEntryPlugin',
],
[
'webpack/lib/optimize/LimitChunkCountPlugin',
'next/dist/compiled/webpack/LimitChunkCountPlugin',
],
[
'webpack/lib/optimize/LimitChunkCountPlugin.js',
'next/dist/compiled/webpack/LimitChunkCountPlugin',
],
[
'webpack/lib/webworker/WebWorkerTemplatePlugin',
'next/dist/compiled/webpack/WebWorkerTemplatePlugin',
],
[
'webpack/lib/webworker/WebWorkerTemplatePlugin.js',
'next/dist/compiled/webpack/WebWorkerTemplatePlugin',
],
[
'webpack/lib/ExternalsPlugin',
'next/dist/compiled/webpack/ExternalsPlugin',
],
[
'webpack/lib/ExternalsPlugin.js',
'next/dist/compiled/webpack/ExternalsPlugin',
],
[
'webpack/lib/web/FetchCompileWasmTemplatePlugin',
'next/dist/compiled/webpack/FetchCompileWasmTemplatePlugin',
],
[
'webpack/lib/web/FetchCompileWasmTemplatePlugin.js',
'next/dist/compiled/webpack/FetchCompileWasmTemplatePlugin',
],
[
'webpack/lib/web/FetchCompileWasmPlugin',
'next/dist/compiled/webpack/FetchCompileWasmPlugin',
],
[
'webpack/lib/web/FetchCompileWasmPlugin.js',
'next/dist/compiled/webpack/FetchCompileWasmPlugin',
],
[
'webpack/lib/web/FetchCompileAsyncWasmPlugin',
'next/dist/compiled/webpack/FetchCompileAsyncWasmPlugin',
],
[
'webpack/lib/web/FetchCompileAsyncWasmPlugin.js',
'next/dist/compiled/webpack/FetchCompileAsyncWasmPlugin',
],
[
'webpack/lib/ModuleFilenameHelpers',
'next/dist/compiled/webpack/ModuleFilenameHelpers',
Expand Down
4 changes: 4 additions & 0 deletions packages/next/bundles/webpack/bundle4.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ module.exports = function () {
Dependency: require('webpack4/lib/Dependency'),
LibraryTemplatePlugin: require('webpack4/lib/LibraryTemplatePlugin'),
SingleEntryPlugin: require('webpack4/lib/SingleEntryPlugin'),
FetchCompileWasmTemplatePlugin: require('webpack4/lib/FetchCompileWasmTemplatePlugin'),
LimitChunkCountPlugin: require('webpack4/lib/optimize/LimitChunkCountPlugin'),
WebWorkerTemplatePlugin: require('webpack4/lib/webworker/WebWorkerTemplatePlugin'),
ExternalsPlugin: require('webpack4/lib/ExternalsPlugin'),
node: require('webpack4').node,
util: require('webpack4').util,
optimize: require('webpack4').optimize,
Expand Down
8 changes: 8 additions & 0 deletions packages/next/bundles/webpack/bundle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ module.exports = function () {
NodeTargetPlugin: require('webpack5/lib/node/NodeTargetPlugin'),
NodeTemplatePlugin: require('webpack5/lib/node/NodeTemplatePlugin'),
LibraryTemplatePlugin: require('webpack5/lib/LibraryTemplatePlugin'),
LimitChunkCountPlugin: require('webpack5/lib/optimize/LimitChunkCountPlugin'),
WebWorkerTemplatePlugin: require('webpack5/lib/webworker/WebWorkerTemplatePlugin'),
ExternalsPlugin: require('webpack5/lib/ExternalsPlugin'),
SingleEntryPlugin: require('webpack5/lib/SingleEntryPlugin'),
FetchCompileAsyncWasmPlugin: require('webpack5/lib/web/FetchCompileAsyncWasmPlugin'),
FetchCompileWasmPlugin: require('webpack5/lib/web/FetchCompileWasmPlugin'),
StringXor: require('webpack5/lib/util/StringXor'),
NormalModule: require('webpack5/lib/NormalModule'),
sources: require('webpack5').sources,
webpack: require('webpack5'),
package: {
version: require('webpack5/package.json').version,
},
}
}
1 change: 1 addition & 0 deletions packages/next/bundles/webpack/packages/ExternalsPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').ExternalsPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileAsyncWasmPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileWasmPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileWasmTemplatePlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').LimitChunkCountPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').WebWorkerTemplatePlugin
2 changes: 1 addition & 1 deletion packages/next/compiled/mini-css-extract-plugin/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/webpack/ExternalsPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').ExternalsPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileAsyncWasmPlugin
1 change: 1 addition & 0 deletions packages/next/compiled/webpack/FetchCompileWasmPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileWasmPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').FetchCompileWasmTemplatePlugin
1 change: 1 addition & 0 deletions packages/next/compiled/webpack/LimitChunkCountPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').LimitChunkCountPlugin
1 change: 1 addition & 0 deletions packages/next/compiled/webpack/WebWorkerTemplatePlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js').WebWorkerTemplatePlugin
12 changes: 12 additions & 0 deletions packages/next/compiled/webpack/bundle4.js
Original file line number Diff line number Diff line change
Expand Up @@ -112409,6 +112409,10 @@ module.exports = function () {
Dependency: __webpack_require__(7550),
LibraryTemplatePlugin: __webpack_require__(39960),
SingleEntryPlugin: __webpack_require__(75462),
FetchCompileWasmTemplatePlugin: __webpack_require__(47842),
LimitChunkCountPlugin: __webpack_require__(58772),
WebWorkerTemplatePlugin: __webpack_require__(52102),
ExternalsPlugin: __webpack_require__(46518),
node: __webpack_require__(3951).node,
util: __webpack_require__(3951).util,
optimize: __webpack_require__(3951).optimize,
Expand All @@ -112421,6 +112425,14 @@ module.exports = function () {
}


/***/ }),

/***/ 47842:
/***/ (function(module) {

module.exports = eval("require")("webpack4/lib/FetchCompileWasmTemplatePlugin");


/***/ }),

/***/ 42357:
Expand Down
25 changes: 25 additions & 0 deletions packages/next/compiled/webpack/bundle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -66703,6 +66703,22 @@ class SelfModuleFactory {
module.exports = SelfModuleFactory;


/***/ }),

/***/ 16551:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sean Larkin @thelarkinn
*/



module.exports = __webpack_require__(82430);


/***/ }),

/***/ 15979:
Expand Down Expand Up @@ -157165,10 +157181,19 @@ module.exports = function () {
NodeTargetPlugin: __webpack_require__(28037),
NodeTemplatePlugin: __webpack_require__(47087),
LibraryTemplatePlugin: __webpack_require__(81735),
LimitChunkCountPlugin: __webpack_require__(22119),
WebWorkerTemplatePlugin: __webpack_require__(9460),
ExternalsPlugin: __webpack_require__(361),
SingleEntryPlugin: __webpack_require__(16551),
FetchCompileAsyncWasmPlugin: __webpack_require__(37118),
FetchCompileWasmPlugin: __webpack_require__(89728),
StringXor: __webpack_require__(23877),
NormalModule: __webpack_require__(11026),
sources: __webpack_require__(48169).sources,
webpack: __webpack_require__(48169),
package: {
version: __webpack_require__(87168)/* .version */ .i8,
},
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ export async function ncc_mini_css_extract_plugin(task, opts) {
...externals,
'./index': './index.js',
'schema-utils': 'next/dist/compiled/schema-utils3',
'webpack-sources': externals['webpack-sources1'],
},
})
.target('compiled/mini-css-extract-plugin')
Expand Down

0 comments on commit 471712f

Please sign in to comment.