File tree Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ var vue = require ( 'vue-loader' )
2
+ var path = require ( 'path' )
3
+ var webpack = require ( "webpack" )
4
+ var ExtractTextPlugin = require ( "extract-text-webpack-plugin" )
5
+ var projectRoot = path . resolve ( __dirname , '../' )
6
+ var cssLoader = ExtractTextPlugin . extract ( 'style-loader' , 'css-loader' )
7
+
8
+ module . exports = {
9
+ entry : {
10
+ 'vue-chartjs' : './src/index.js'
11
+ } ,
12
+ output : {
13
+ filename : './dist/[name].js' ,
14
+ library : 'VueChartJs' ,
15
+ libraryTarget : 'umd'
16
+ } ,
17
+ module : {
18
+ preLoaders : [
19
+ {
20
+ test : / \. v u e $ / ,
21
+ loader : 'eslint' ,
22
+ include : projectRoot ,
23
+ exclude : / n o d e _ m o d u l e s /
24
+ } ,
25
+ {
26
+ test : / \. j s $ / ,
27
+ loader : 'eslint' ,
28
+ include : projectRoot ,
29
+ exclude : / n o d e _ m o d u l e s /
30
+ }
31
+ ] ,
32
+ loaders : [
33
+ {
34
+ test : / \. v u e $ / ,
35
+ loader : 'vue'
36
+ } ,
37
+ {
38
+ test : / \. j s $ / ,
39
+ exclude : / n o d e _ m o d u l e s / ,
40
+ loader : 'babel'
41
+ } ,
42
+ {
43
+ test : / \. c s s $ / ,
44
+ loader : cssLoader
45
+ } ,
46
+ {
47
+ test : / \. s [ a | c ] s s $ / ,
48
+ loader : ExtractTextPlugin . extract ( 'style-loader' , 'css-loader!sass-loader' )
49
+ }
50
+ ]
51
+ } ,
52
+ eslint : {
53
+ formatter : require ( 'eslint-friendly-formatter' )
54
+ } ,
55
+ babel : {
56
+ presets : [ 'es2015' ] ,
57
+ plugins : [ 'transform-runtime' ]
58
+ }
59
+ }
60
+
61
+ if ( process . env . NODE_ENV === 'production' ) {
62
+
63
+ delete module . exports . devtool
64
+ module . exports . plugins = [
65
+ new webpack . DefinePlugin ( {
66
+ 'process.env' : {
67
+ NODE_ENV : '"production"'
68
+ }
69
+ } ) ,
70
+ new webpack . optimize . UglifyJsPlugin ( {
71
+ compress : {
72
+ warnings : false
73
+ }
74
+ } ) ,
75
+ new webpack . optimize . OccurenceOrderPlugin ( )
76
+ // new ExtractTextPlugin('build.css')
77
+ ]
78
+ }
Original file line number Diff line number Diff line change 22
22
"e2e" : " node test/e2e/runner.js" ,
23
23
"test" : " npm run unit" ,
24
24
"lint" : " eslint --ext .js,.vue src test/unit/specs test/e2e/specs" ,
25
+ "release" : " webpack --progress --hide-modules --config ./build/webpack.release.js" ,
25
26
"prepublish" : " node build/build.js"
26
27
},
27
28
"dependencies" : {
You can’t perform that action at this time.
0 commit comments