You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you're using dynamic import with dynamic resource name with feature layers enabled, the dynamic imported files didn't inherit with the parent layer
This pull request adds support for layers in ContextModule and tests the feature with different scenarios of dynamic imports and resources. It also adds a new rule to the webpack configuration file for assigning modules to layers based on their names.
Details
🤖 Generated by Copilot at 8422d51
Add layer property to ContextModule class and its serialization and deserialization methods (link, link, link)
Set layer property of data object in ContextModuleFactory class from contextInfo object populated by ContextDependency class (link)
Add new rule to webpack configuration file to assign dynamic-layer layer to files matching dynamic-module-layer in name (test/configCases/layer/rules/webpack.config.js, link)
Add new test case file dynamic-module-layer.js to export an object with name, layer, and modules properties, where modules is an array of promises resolving to dynamic modules imported with dynamic resources (test/configCases/layer/rules/dynamic-module-layer.js, link)
Add new test case files module1.js and module2.js to export objects with name and layer properties, where layer is a special variable __webpack_layer__ replaced by webpack at runtime (test/configCases/layer/rules/dynamic/module1.js, link; test/configCases/layer/rules/dynamic/module2.js, link)
Import object from dynamic-module-layer.js and add new test case to assert that layer property of object and dynamic modules match dynamic-layer (test/configCases/layer/rules/index.js, link, link)
The text was updated successfully, but these errors were encountered:
A pull request by @huozhi was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#17310
Summary
When you're using dynamic import with dynamic resource name with feature
layers
enabled, the dynamic imported files didn't inherit with the parent layerrelated issue on next.js side: vercel/next.js#49382
🤖 Generated by Copilot at 8422d51
This pull request adds support for layers in
ContextModule
and tests the feature with different scenarios of dynamic imports and resources. It also adds a new rule to the webpack configuration file for assigning modules to layers based on their names.Details
🤖 Generated by Copilot at 8422d51
layer
property toContextModule
class and its serialization and deserialization methods (link, link, link)layer
property ofdata
object inContextModuleFactory
class fromcontextInfo
object populated byContextDependency
class (link)dynamic-layer
layer to files matchingdynamic-module-layer
in name (test/configCases/layer/rules/webpack.config.js
, link)dynamic-module-layer.js
to export an object with name, layer, and modules properties, where modules is an array of promises resolving to dynamic modules imported with dynamic resources (test/configCases/layer/rules/dynamic-module-layer.js
, link)module1.js
andmodule2.js
to export objects with name and layer properties, where layer is a special variable__webpack_layer__
replaced by webpack at runtime (test/configCases/layer/rules/dynamic/module1.js
, link;test/configCases/layer/rules/dynamic/module2.js
, link)dynamic-module-layer.js
and add new test case to assert that layer property of object and dynamic modules matchdynamic-layer
(test/configCases/layer/rules/index.js
, link, link)The text was updated successfully, but these errors were encountered: