File tree Expand file tree Collapse file tree 1 file changed +23
-18
lines changed Expand file tree Collapse file tree 1 file changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,8 @@ import pkg from "./package.json";
88
99const resolve = ( _path ) => path . resolve ( __dirname , _path ) ;
1010
11- export default {
11+ const rootConfig = {
1212 input : resolve ( "./src/index.js" ) ,
13- output : [
14- {
15- file : pkg . main ,
16- name : "VueLive" ,
17- format : "cjs" ,
18- exports : "named" , // remove warning about mixed exports
19- } ,
20- {
21- file : pkg . module ,
22- format : "es" , // the preferred format
23- } ,
24- ] ,
2513 plugins : [
2614 commonjs ( ) ,
2715 babel ( {
@@ -31,11 +19,6 @@ export default {
3119 extensions : [ ".js" ] ,
3220 babelHelpers : "runtime" ,
3321 } ) ,
34- vue ( {
35- template : {
36- isProduction : true ,
37- } ,
38- } ) ,
3922 css ( ) ,
4023 analyze ( { summaryOnly : true } ) ,
4124 ] ,
@@ -53,3 +36,25 @@ export default {
5336 "@vue/compiler-core/dist/compiler-core.cjs" ,
5437 ] ,
5538} ;
39+
40+ export default [
41+ // ESM build to be used with webpack/rollup.
42+ {
43+ ...rootConfig ,
44+ output : {
45+ format : "esm" ,
46+ file : pkg . module ,
47+ } ,
48+ plugins : [ ...rootConfig . plugins , vue ( ) ] ,
49+ } ,
50+ // SSR build.
51+ {
52+ ...rootConfig ,
53+ output : {
54+ format : "cjs" ,
55+ file : pkg . main ,
56+ exports : "named" , // remove warning about mixed exports
57+ } ,
58+ plugins : [ ...rootConfig . plugins , vue ( { template : { optimizeSSR : true } } ) ] ,
59+ } ,
60+ ] ;
You can’t perform that action at this time.
0 commit comments