Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/runtime-vapor/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'

if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/runtime-vapor.cjs.prod.js')
} else {
module.exports = require('./dist/runtime-vapor.cjs.js')
}
8 changes: 7 additions & 1 deletion packages/runtime-vapor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"exports": {
".": {
"types": "./dist/runtime-vapor.d.ts",
"node": {
"production": "./dist/runtime-vapor.cjs.prod.js",
"development": "./dist/runtime-vapor.cjs.js",
"default": "./index.js"
},
"default": "./dist/runtime-vapor.esm-bundler.js"
},
"./*": "./*"
Expand All @@ -20,7 +25,8 @@
"buildOptions": {
"name": "VueRuntimeVapor",
"formats": [
"esm-bundler"
"esm-bundler",
"cjs"
]
},
"repository": {
Expand Down
1 change: 0 additions & 1 deletion packages/vue/src/index-with-vapor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// for type generation only
export * from './index'
export * from '@vue/runtime-vapor'
export type { VaporSlot } from '@vue/runtime-vapor'
export { withAsyncContext } from '@vue/runtime-vapor'
1 change: 1 addition & 0 deletions packages/vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ registerRuntimeCompiler(compileToFunction)

export { compileToFunction as compile }
export * from '@vue/runtime-dom'
export * from '@vue/runtime-vapor'
Comment thread
zhiyuanzmj marked this conversation as resolved.
1 change: 0 additions & 1 deletion packages/vue/src/runtime-with-vapor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './runtime'
export * from '@vue/runtime-vapor'
export type { VaporSlot } from '@vue/runtime-vapor'
export { withAsyncContext } from '@vue/runtime-vapor'
1 change: 1 addition & 0 deletions packages/vue/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (__DEV__) {
}

export * from '@vue/runtime-dom'
export * from '@vue/runtime-vapor'
Comment thread
zhiyuanzmj marked this conversation as resolved.

export const compile = (_template: string): RenderFunction => {
if (__DEV__) {
Expand Down
28 changes: 14 additions & 14 deletions scripts/trim-vapor-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ export function trimVaporExportsPlugin(format, pkgName) {
return []
} else {
return [
{
name: 'trim-vapor-exports',
transform: {
filter: {
id: {
include: /runtime-(core|dom)\/src\/index\.ts$/,
},
},
handler(code) {
const index = code.lastIndexOf('// VAPOR ---')
return code.slice(0, index)
},
},
},
// {
// name: 'trim-vapor-exports',
// transform: {
// filter: {
// id: {
// include: /runtime-(core|dom)\/src\/index\.ts$/,
// },
// },
// handler(code) {
// const index = code.lastIndexOf('// VAPOR ---')
// return code.slice(0, index)
// },
// },
// },
Comment thread
zhiyuanzmj marked this conversation as resolved.
Comment thread
zhiyuanzmj marked this conversation as resolved.
]
}
}
Loading