Skip to content

ekuai-mall/import-weapp-component

 
 

Repository files navigation

Forked from JJJYY/import-weapp-component

修改以适用最新版本 F-loat/mpvue-quickstart (app.json)

plugins: [
    new ImportComponent({
      src: path.resolve(__dirname, '../src'), // 引用组件或原生页面的目录
      usingComponents: path.resolve(__dirname, '../src/app.json'), // mpvue-entry 配置路径
      forceCopy:[
		path.resolve(__dirname, '../vant-weapp/wxs'),
		path.resolve(__dirname, '../vant-weapp/common/index.wxss')
      ]
    })
  ]

Forked from webpack-contrib/copy-webpack-plugin

Author: Len Boyette

License: MIT

简介:根据json文件usingComponents自动引入组件,兼容mpvue-entry

支持最新版本mpvue, 请按照如下用法进行配置


Webpack Plugin Import Weapp Component

Import wechat app native component

Install

npm i -D import-weapp-component

Usage

webpack.config.js

const ImportComponent = require('import-weapp-component')

const config = {
  plugins: [
    new ImportComponent({
      src: path.resolve(__dirname, '../src'), // 引用组件或原生页面的目录
      native: true, // 将 src 目录中的原生 page 复制到 dist
      usingComponents: path.resolve(__dirname, '../src/page.js') // mpvue-entry 配置路径
    })
  ]
}

About

import weapp components webpack plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%