File tree Expand file tree Collapse file tree 3 files changed +24
-37
lines changed Expand file tree Collapse file tree 3 files changed +24
-37
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,13 @@ import pkg from "./package.json";
88const resolve = ( _path ) => path . resolve ( __dirname , _path ) ;
99
1010export default {
11- input : resolve ( "./src/main .js" ) ,
11+ input : resolve ( "./src/index .js" ) ,
1212 output : [
1313 {
1414 file : pkg . main ,
1515 name : "VueLive" ,
16- format : "umd " ,
16+ format : "cjs " ,
1717 exports : "named" , // remove warning about mixed exports
18- globals : {
19- "hash-sum" : "vueLiveHashSum" ,
20- "vue-inbrowser-compiler" : "vueLivevueInbrowserCompiler" ,
21- "vue-template-compiler" : "vueLiveVueTemplateCompiler" ,
22- "vue-prism-editor" : "VuePrismEditor" ,
23- debounce : "debounce" ,
24- acorn : "acorn" ,
25- recast : "recast" ,
26- } ,
2718 } ,
2819 {
2920 file : pkg . module ,
@@ -40,15 +31,16 @@ export default {
4031 runtimeHelpers : true ,
4132 } ) ,
4233 vue ( {
43- template : {
44- optimizeSSR : true
45- }
46- } ) ,
34+ template : {
35+ optimizeSSR : true ,
36+ } ,
37+ } ) ,
4738 css ( ) ,
4839 ] ,
4940 external : [
5041 ...Object . keys ( pkg . dependencies ) ,
5142 // make sure jsx schema is loaded from external
5243 "prismjs/components/prism-jsx.min" ,
44+ "@vue/compiler-core/dist/compiler-core.cjs" ,
5345 ] ,
5446} ;
Original file line number Diff line number Diff line change 1- import VueLive from ' ./VueLive' ;
2- import VueLiveEditor from './Editor' ;
3- import VueLivePreview from './Preview ' ;
1+ import VueLive from " ./VueLive.vue" ;
2+ import VueLivePreview from "./Preview.vue" ;
3+ import VueLiveEditor from './Editor.vue ' ;
44
5- export { VueLive , VueLiveEditor , VueLivePreview } ;
5+ // Export components individually
6+ export { VueLive } ;
7+ export { VueLivePreview } ;
8+ export { VueLiveEditor } ;
9+
10+ // What should happen if the user installs the library as a plugin
11+ function install ( Vue ) {
12+ Vue . component ( "VueLive" , VueLive ) ;
13+ Vue . component ( "VueLivePreview" , VueLivePreview ) ;
14+ Vue . component ( "VueLiveEditor" , VueLiveEditor ) ;
15+ }
16+
17+ // Export the library as a plugin
18+ export default { install : install } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments