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
Support a syntax like require.context('./modules', true, /\.js$/, 'lazy', 'myModule') to allow specifying a fixed chunkName.
What is motivation or use case for adding/changing the behavior?
I want to split some code and pack them into a single file about operating dialogs from a enormous module.
require.context() doesn't support specifying a fixed chunkName.
require.ensure() and import() don't support passing expressions as module names.
How should this be implemented in your opinion?
I try to turn webpack\lib\dependencies\RequireContextDependencyParserPlugin.js into a new async-import-plugin. It supports the fifth param which can pass a fixed chunkName. The following is a replaying step.
Feature request
What is the expected behavior?
Support a syntax like
require.context('./modules', true, /\.js$/, 'lazy', 'myModule')
to allow specifying a fixed chunkName.What is motivation or use case for adding/changing the behavior?
I want to split some code and pack them into a single file about operating dialogs from a enormous module.
require.context()
doesn't support specifying a fixed chunkName.require.ensure()
andimport()
don't support passing expressions as module names.How should this be implemented in your opinion?
I try to turn
webpack\lib\dependencies\RequireContextDependencyParserPlugin.js
into a new async-import-plugin. It supports the fifth param which can pass a fixed chunkName. The following is a replaying step.npm i
.webpack\lib\ContextModule.js
.npm run build
, thenrequire.asyncImport('./modules', true, /\.js$/, 'lazy', '$myModule$')
in index.js can achieve the target.Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: