workflow(sfc-playground): tweaks and commit links

This commit is contained in:
Evan You
2021-03-29 02:07:04 -04:00
parent 69b4727204
commit 3aaa53748b
6 changed files with 106 additions and 64 deletions

View File

@@ -2,9 +2,15 @@ import fs from 'fs'
import path from 'path'
import { defineConfig, Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import execa from 'execa'
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
export default defineConfig({
plugins: [vue(), copyVuePlugin()],
define: {
__COMMIT__: JSON.stringify(commit)
},
optimizeDeps: {
exclude: ['consolidate']
}
@@ -13,7 +19,7 @@ export default defineConfig({
function copyVuePlugin(): Plugin {
return {
name: 'copy-vue',
generateBundle(_opts, bundle) {
generateBundle() {
const filePath = path.resolve(
__dirname,
'../vue/dist/vue.runtime.esm-browser.js'