@@ -10,6 +10,7 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin')
10
10
var OptimizeCSSPlugin = require ( 'optimize-css-assets-webpack-plugin' )
11
11
12
12
var isDist = ! ! process . env . DIST_ENV
13
+ var distPath = './dist'
13
14
14
15
var env = process . env . NODE_ENV === 'testing'
15
16
? require ( '../config/test.env' )
@@ -38,7 +39,13 @@ var webpackConfig = merge(baseWebpackConfig, {
38
39
warnings : false
39
40
} ,
40
41
sourceMap : config . build . productionSourceMap
41
- } )
42
+ } ) ,
43
+ new CopyWebpackPlugin ( [
44
+ {
45
+ from : path . resolve ( __dirname , '../README.md' ) ,
46
+ to : isDist ? distPath : config . build . assetsRoot
47
+ }
48
+ ] )
42
49
]
43
50
} )
44
51
@@ -47,10 +54,18 @@ if (isDist) {
47
54
'vue-json-pretty' : './src/index.js'
48
55
}
49
56
webpackConfig . output = {
50
- filename : './dist/ [name].js' ,
57
+ filename : ` ${ distPath } / [name].js` ,
51
58
library : 'VueJsonPretty' ,
52
59
libraryTarget : 'umd'
53
60
}
61
+ webpackConfig . plugins . push (
62
+ new CopyWebpackPlugin ( [
63
+ {
64
+ from : path . resolve ( __dirname , '../package.json' ) ,
65
+ to : distPath
66
+ }
67
+ ] )
68
+ )
54
69
} else {
55
70
webpackConfig . plugins . push (
56
71
// extract css into its own file
0 commit comments