File tree Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -19,27 +19,46 @@ var main = fs
19
19
. replace ( / V u e \. v e r s i o n = ' [ \d \. ] + ' / , "Vue.version = '" + version + "'" )
20
20
fs . writeFileSync ( 'src/index.js' , main )
21
21
22
- // Dev build
22
+ // CommonJS build.
23
+ // this is used as the "main" field in package.json
24
+ // and used by bundlers like Webpack and Browserify.
23
25
rollup . rollup ( {
24
26
entry : 'src/index.js' ,
25
27
plugins : [
26
- replace ( {
27
- 'process.env.NODE_ENV' : "'development'"
28
- } ) ,
29
28
babel ( {
30
29
loose : 'all'
31
30
} )
32
31
]
33
32
} )
34
33
. then ( function ( bundle ) {
35
- return write ( 'dist/vue.js' , bundle . generate ( {
36
- format : 'umd' ,
37
- banner : banner ,
38
- moduleName : 'Vue'
34
+ return write ( 'dist/vue.common.js' , bundle . generate ( {
35
+ format : 'cjs' ,
36
+ banner : banner
39
37
} ) . code )
40
38
} )
39
+ // Standalone Dev Build
41
40
. then ( function ( ) {
42
- // Production build
41
+ return rollup . rollup ( {
42
+ entry : 'src/index.js' ,
43
+ plugins : [
44
+ replace ( {
45
+ 'process.env.NODE_ENV' : "'development'"
46
+ } ) ,
47
+ babel ( {
48
+ loose : 'all'
49
+ } )
50
+ ]
51
+ } )
52
+ . then ( function ( bundle ) {
53
+ return write ( 'dist/vue.js' , bundle . generate ( {
54
+ format : 'umd' ,
55
+ banner : banner ,
56
+ moduleName : 'Vue'
57
+ } ) . code )
58
+ } )
59
+ } )
60
+ . then ( function ( ) {
61
+ // Standalone Production Build
43
62
return rollup . rollup ( {
44
63
entry : 'src/index.js' ,
45
64
plugins : [
Original file line number Diff line number Diff line change 9
9
" browser" ,
10
10
" framework"
11
11
],
12
- "main" : " dist/vue.js" ,
12
+ "main" : " dist/vue.common. js" ,
13
13
"files" : [
14
14
" dist/vue.js" ,
15
15
" dist/vue.min.js" ,
16
+ " dist/vue.common.js" ,
16
17
" src"
17
18
],
18
19
"repository" : {
You can’t perform that action at this time.
0 commit comments