
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
miniprogram-webpack-plugin
Advanced tools
微信小程序 webpack 插件
yarn 或 npm 引入和使用 node_modules 模块loaders 和 pluginsaliassass、lessapp.js, app.json, pages/index/index.js 等等),使用这个插件只需要引入 app.js 即可,其余文件将会被自动引入pages/index/index.js 和 pages/logs/logs.js)引入有相同的模块,这个插件能避免重复打包相同模块app.json 上的 tabbar 图片json文件common.js到分包root目录下npm i -S miniprogram-webpack-plugin
在 entry 上引入 { app: './src/app.js' }, 这里的 ./src/app.js 为微信小程序开发所需的 app.js。注意 key 必须为 app,value为app.js文件)
在 output 上设置 filename: '[name].js'。 注意 这里 [name].js 是因为 webpack 将会打包生成多个文件,文件名称将以 [name] 规则来输出
添加 new MiniProgramWebpackPlugin() 到 plugins
完整的项目开发脚手架,请查看 quickstart-miniprogram
webpack.config.babel.js
import MiniProgramWebpackPlugin from 'miniprogram-webpack-plugin';
export default {
// ...configs,
plugins: [
// ...other,
new MiniProgramWebpackPlugin(options)
],
};
所有 Options 均为可选
clear (<Boolean>): 在启动 webpack 时清空 output 目录。默认为 trueextensions (<Array<String>>): 脚本文件后缀名。默认为 ['.js','ts']include (<Array<String>>): 静态资源目录。eg:[" /assets/**/* "]exclude (<Array<String>>): 排除静态资源目录。eg:[" /doc/**/* "]src (源)目录创建 app.js、app.json、app.wxss、pages/index/index.js 之类的文件进行开发usingComponents中对应组件增加/npm-components这个前缀,打包出来会提取node_modules中的组定义组件到输出目录npm-components文件夹MIT © fupengl
FAQs
微信小程序 Webpack 插件
The npm package miniprogram-webpack-plugin receives a total of 11 weekly downloads. As such, miniprogram-webpack-plugin popularity was classified as not popular.
We found that miniprogram-webpack-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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.