
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
webpack-modules
Advanced tools
Handle
.mjsfiles correctly
Because webpack does it wrong and won't fix it.
Without this plugin, .mjs files will only consider other .mjs files as ESM. It completely disregards any .js files in the ESM format, forcing them to seen & treated as CommonJS modules (despite their contents). (comment)
Additionally, without this plugin, .mjs files do not follow the same resolve.mainFields sequence that's defined in your main configuration. (comment)
The plugin takes no options. Simply require it and invoke like any other plugin~
// webpack.config.js
const WebpackModules = require('webpack-modules');
module.exports = {
// ...
plugins: [
new WebpackModules()
]
}
Thank you to @ForsakenHarmony who did the research and legwork as part of preact-cli – via this and that.
MIT © Luke Edwards
FAQs
Handle ".mjs" files correctly
The npm package webpack-modules receives a total of 3,966 weekly downloads. As such, webpack-modules popularity was classified as popular.
We found that webpack-modules 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.