Skip to content

Commit b651324

Browse files
committedSep 9, 2021
stub in ssr
1 parent 3987302 commit b651324

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed
 

‎package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
"name": "@vue/repl",
33
"version": "0.2.3",
44
"description": "Vue component for editing Vue components",
5-
"main": "dist/vue-repl.js",
5+
"main": "dist/ssr-stub.js",
6+
"module": "dist/vue-repl.js",
67
"files": [
78
"dist"
89
],
910
"exports": {
10-
".": "./dist/vue-repl.js",
11+
".": {
12+
"import": "./dist/vue-repl.js",
13+
"require": "./dist/ssr-stub.js"
14+
},
1115
"./style.css": "./dist/style.css",
1216
"./dist/style.css": "./dist/style.css"
1317
},

‎ssr-stub.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {}

‎vite.config.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
import { defineConfig } from 'vite'
1+
import { defineConfig, Plugin } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33

4+
const genStub: Plugin = {
5+
name: 'gen-stub',
6+
apply: 'build',
7+
generateBundle() {
8+
this.emitFile({
9+
type: 'asset',
10+
fileName: 'ssr-stub.js',
11+
source: `module.exports = {}`
12+
})
13+
}
14+
}
15+
416
export default defineConfig({
5-
plugins: [vue()],
17+
plugins: [vue(), genStub],
618
build: {
719
minify: false,
820
lib: {

0 commit comments

Comments
 (0)
Please sign in to comment.