
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
absolute-module-mapper-plugin
Advanced tools
The plugin on enhanced-resolver to map module path
It's helpful when we need to adjust third-party library dependencies. for example:
We have the follow project directory tree now.
project/
node_modules/
antd/
lib/
components/
icon/
index.js
button/
index.js # requires icon/index.js
...
wrapper/
button/
index.js
icon/
index.js
And the point is antd/button requires antd/icon, but we prefer it requires wrapper/icon which we can customize.
So we could use this plugin in webpack, let antd/icon in antd/button is mapped to wrapper/icon.
npm install absolute-module-mapper-plugin
# or use yarn
yarn add absolute-module-mapper-plugin
const AbsoluteModuleMapperPlugin = require('absolute-module-mapper-plugin')
const webpackConfig = {
resolve: {
plugins: [
new AbsoluteModuleMapperPlugin({
root: '/project',
include: [
'<root>/node_modules/antd/lib/components/button'
],
mapper: {
'^<root>/node_modules/antd/lib/components/icon/index.js': '<root>/wrapper/icon/index.js'
}
})
]
}
}
silentShow some runtime log
truerootAssign root path, it is the value for <root> placeholder.
stringincludeThe included paths for mapping
Array<string|Function|RegExp>[options.root]excludeThe excluded paths for mapping
Array<string|Function|RegExp>[]mapperabsolute filename mapper.
(filename, ctx) => string | (filename, ctx, callback) => void | {}{
'^<root>/from/(\w+)': '<root>/to/$1'
}
requestMapperrequest mapper.
(request, ctx) => string | (request, ctx, callback) => void | {}{
'^./a.js$': './b.js'
}
git checkout -b feature-new or git checkout -b fix-which-buggit commit -am 'feat: some description (close #123)' or git commit -am 'fix: some description (fix #123)'git pushThis library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT - imcuttle 🐟
FAQs
The plugin on enhanced-resolver to map module path
We found that absolute-module-mapper-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.