Skip to content

Commit 40ba84e

Browse files
Update vite.config.ts
1 parent 783902e commit 40ba84e

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright (c) 2023 - present TinyEngine Authors.
3+
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
4+
*
5+
* Use of this source code is governed by an MIT-style license.
6+
*
7+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+
*
11+
*/
12+
13+
import { defineConfig } from 'vite'
14+
import path from 'path'
15+
import vue from '@vitejs/plugin-vue'
16+
import vueJsx from '@vitejs/plugin-vue-jsx'
17+
import generateComment from '@opentiny/tiny-engine-vite-plugin-meta-comments'
18+
19+
// https://vitejs.dev/config/
20+
export default defineConfig({
21+
plugins: [generateComment(), vue(), vueJsx()],
22+
publicDir: false,
23+
resolve: {},
24+
build: {
25+
sourcemap: true,
26+
lib: {
27+
entry: path.resolve(__dirname, './index.ts'),
28+
name: 'plugin-resource',
29+
fileName: (_format, entryName) => `${entryName}.js`,
30+
formats: ['es']
31+
},
32+
rollupOptions: {
33+
output: {
34+
banner: 'import "./style.css"'
35+
},
36+
external: ['vue', /@opentiny\/tiny-engine.*/, /@opentiny\/vue.*/]
37+
}
38+
}
39+
})

0 commit comments

Comments
 (0)