
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
webpack-node-module-plugin
Advanced tools
react-native-web 同构模式下 服务端打包插件
使用webpack打包服务端代码时,可以不进行文件合并,而是保留原始目录结构产出
打包后的文件。
npm install webpack-node-module-plugin --save-dev
Webpack config example:
var NodeModulePlugin =require('webpack-node-module-plugin').NodeModulePlugin;
// 静态资源url前是否添加一个全局变量进行拼接
// 例如:require('./images/a.jpg') --> webpack --> __cdnurl+'/app/assets/sdf23422sssdf.jpg'
var cdnVariableName= '__cdnurl__';
// 发布目录根路径 copyNodeMoudles为false时可以不传递
var targetRoot = 'd:/release/web';
// 是否复制node_modules到发布目录下 默认: false
var copyNodeMoudles = true;
module.exports = {
entry: {
'server': ['./index.web.js']
},
output: {
path: ...,
filename: 'server/[name].js',
publicPath: '/assets/',
libraryTarget: 'commonjs2'
},
plugins:[
....
new NodeModulePlugin('rootDir',cdnVariableName,targetRoot,copyNodeMoudles)
]
}
基于 MIT License 开源,使用代码只需说明来源,或者引用 license.txt 即可。
FAQs
[![NPM version][npm-image]][npm-url]
We found that webpack-node-module-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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.