Skip to content

Commit da105a4

Browse files
authored
feat: add core entry for node usage (#310)
1 parent 9ae056b commit da105a4

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"import": "./dist/codemirror-editor.js",
2727
"require": null
2828
},
29+
"./core": {
30+
"types": "./dist/core.d.ts",
31+
"import": "./dist/core.js",
32+
"require": null
33+
},
2934
"./package.json": "./package.json",
3035
"./style.css": "./dist/vue-repl.css",
3136
"./dist/style.css": "./dist/vue-repl.css"

src/core.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export {
2+
useStore,
3+
File,
4+
type SFCOptions,
5+
type StoreState,
6+
type Store,
7+
type ReplStore,
8+
} from './store'
9+
export { useVueImportMap, mergeImportMap, type ImportMap } from './import-map'
10+
export { compileFile } from './transform'
11+
export { version as languageToolsVersion } from '@vue/language-service/package.json'

src/index.ts

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
export { default as Repl } from './Repl.vue'
1+
export { default as Repl, type Props as ReplProps } from './Repl.vue'
22
export { default as Preview } from './output/Preview.vue'
3-
export { default as Sandbox } from './output/Sandbox.vue'
4-
export type { SandboxProps } from './output/Sandbox.vue'
5-
export {
6-
useStore,
7-
File,
8-
type SFCOptions,
9-
type StoreState,
10-
type Store,
11-
type ReplStore,
12-
} from './store'
13-
export { useVueImportMap, mergeImportMap, type ImportMap } from './import-map'
14-
export { compileFile } from './transform'
15-
export type { Props as ReplProps } from './Repl.vue'
3+
export { default as Sandbox, type SandboxProps } from './output/Sandbox.vue'
164
export type { OutputModes } from './types'
17-
export { version as languageToolsVersion } from '@vue/language-service/package.json'
5+
export * from './core'

vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default mergeConfig(base, {
5757
lib: {
5858
entry: {
5959
'vue-repl': './src/index.ts',
60+
core: './src/core.ts',
6061
'monaco-editor': './src/editor/MonacoEditor.vue',
6162
'codemirror-editor': './src/editor/CodeMirrorEditor.vue',
6263
},

0 commit comments

Comments
 (0)