miniprogram-webpack-plugin weekly downloads statistics
By fupengl · npm · Webpack plugins
微信小程序 Webpack 插件
miniprogram-webpack-plugin has 4 recorded weekly downloads on npm, ranking #2273 of 2,667 tracked listings.
About miniprogram-webpack-plugin
miniprogram-webpack-plugin
微信小程序 webpack 插件
为什么要使用 webpack
- 支持通过
yarn或npm引入和使用node_modules模块 - 支持丰富且灵活的
loaders和plugins - 支持
alias - 支持
sass、less - 支持引入npm自定义组件
为什么要使用这个插件
- 微信小程序开发需要有多个入口文件(如
app.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
配置 webpack
-
在
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
API
MiniProgramWebpackPlugin
用法
webpack.config.babel.js
import MiniProgramWebpackPlugin from 'miniprogram-webpack-plugin';
export default {
// ...configs,
plugins: [
// ...other,
new MiniProgramWebpackPlugin(options)
],
};
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之类的文件进行开发 - 引入node_modules的包,只需要
usingComponents中对应组件增加/npm-components这个前缀,打包出来会提取node_modules中的组定义组件到输出目录npm-components文件夹
License
MIT © fupengl
Description from the npm listing.
- miniprogram
- weapp
- webpack
- webpack-plugin
- miniprogram-webpack
- wxapp-webpack
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm Webpack plugins plugins
All 20 miniprogram-webpack-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/miniprogram-webpack-plugin. First seen Oct 29, 2026; last successful collection Oct 29, 2026. See the methodology.