File tree Expand file tree Collapse file tree 5 files changed +422
-10
lines changed
packages/vite-plugin-vue-i18n Expand file tree Collapse file tree 5 files changed +422
-10
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import { defineConfig } from 'vite'
51
51
import { resolve , dirname } from ' node:path'
52
52
import { fileURLToPath } from ' url'
53
53
import vue from ' @vitejs/plugin-vue'
54
- import { vueI18n } from ' @intlify/vite-plugin-vue-i18n'
54
+ import vueI18n from ' @intlify/vite-plugin-vue-i18n'
55
55
56
56
export default defineConfig ({
57
57
plugins: [
Original file line number Diff line number Diff line change
1
+ import { defineBuildConfig } from 'unbuild'
2
+
3
+ export default defineBuildConfig ( {
4
+ declaration : true ,
5
+ outDir : 'lib' ,
6
+ entries : [
7
+ {
8
+ name : 'index' ,
9
+ input : 'src/index'
10
+ }
11
+ ] ,
12
+ rollup : {
13
+ emitCJS : true
14
+ } ,
15
+ externals : [ 'vite' ]
16
+ } )
Original file line number Diff line number Diff line change 33
33
"fast-glob" : " ^3.2.5" ,
34
34
"source-map" : " 0.6.1"
35
35
},
36
+ "devDependencies" : {
37
+ "unbuild" : " ^0.7.6"
38
+ },
36
39
"engines" : {
37
40
"node" : " >= 14.6"
38
41
},
51
54
" vue-i18n"
52
55
],
53
56
"license" : " MIT" ,
54
- "main" : " lib/index.js " ,
55
- "module" : " ./index.mjs" ,
57
+ "main" : " lib/index.cjs " ,
58
+ "module" : " ./lib/ index.mjs" ,
56
59
"types" : " lib/index.d.ts" ,
57
60
"exports" : {
58
61
"." : {
59
- "import" : " ./index.mjs" ,
60
- "require" : " ./lib/index.js "
62
+ "import" : " ./lib/ index.mjs" ,
63
+ "require" : " ./lib/index.cjs "
61
64
},
62
65
"./lib/*" : " ./lib/*" ,
63
66
"./index.mjs" : " ./index.mjs" ,
69
72
"directory" : " packages/vite-plugin-vue-i18n"
70
73
},
71
74
"scripts" : {
72
- "build" : " tsc -p . " ,
75
+ "build" : " unbuild " ,
73
76
"build:example" : " vite build --config ./examples/vite.config.ts --outDir ./examples/dist" ,
74
77
"clean" : " npm-run-all \" clean:*\" " ,
75
78
"clean:lib" : " rm -rf ./lib" ,
Original file line number Diff line number Diff line change @@ -403,6 +403,4 @@ async function generateBundleResources(
403
403
}`
404
404
}
405
405
406
- // overwrite for cjs require('...')() usage
407
406
export default pluginI18n
408
- export const vueI18n = pluginI18n
You can’t perform that action at this time.
0 commit comments