0.0.4 • Published 9 months ago

@plugin-light/webpack-plugin-replace-app-id v0.0.4

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

小程序 AppId 转换

可用于动态替换小程序编译产物的project.config.json中的appid,适用于一个子工程下,不同页面属于不同小程序的场景。

如何使用

安装

pnpm add @plugin-light/webpack-plugin-replace-app-id -D

vue.config.js 中添加如下设置:

const { ReplaceAppIdPlugin } = require('@plugin-light/webpack-plugin-replace-app-id');


module.exports = {
  configureWebpack: {
    plugins: [
      new ReplaceAppIdPlugin({
        appId: 'xxx'
      })
    ],
  }
}

参数

export type IReplaceAppIdOptions = {
  // 将要替换的 appId
  appId: string;
};
0.0.4

9 months ago