0.5.2 • Published 4 months ago

@youdeyiwu/vite-plugin-mp v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

vite-plugin-youdeyiwu-mp

使用 vite + typescript + sass 构建编译微信小程序

注意使用的版本,该插件测试的模板为微信小程序 Ts + Scss,以及 Vite 5

安装

  • yarn
yarn add -D glob rollup-plugin-copy

使用

  • 编辑 vite.config.ts 文件添加插件
import {defineConfig} from 'vite';
import path from "path";
import youdeyiwuMp from '@youdeyiwu/vite-plugin-mp';

export default defineConfig({
    plugins: [
        youdeyiwuMp({
            buildDir: path.resolve(__dirname, 'miniprogram'),
            outputDir: path.resolve(__dirname, 'dist')
        })
    ]
})
  • 构建编译小程序
yarn build

选项

  • buildDir 必填。编译小程序的代码目录
  • outputDir 必填。输出编译小程序的代码目录

其他

如果遇到无法编译,考虑移除该插件,因为该插件只是使用 vite 来对文件进行编译而已

即使不使用 vite,微信开发者工具也能进行编译,除此之外没有区别

移除该插件,剩下的就是熟悉的微信小程序代码

License

MIT

0.5.2

4 months ago

0.5.0

5 months ago

0.5.1

5 months ago

0.3.0

9 months ago

0.3.2

8 months ago

0.4.0

7 months ago

0.3.1

9 months ago

0.3.3

8 months ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.0

1 year ago