forked from seeksdream/relation-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
111 lines (111 loc) · 2.51 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const webpack = require('webpack')
const path = require('path')
const { merge } = require('webpack-merge')
// var VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = merge({
// devtool: 'source-map',
entry: {
'relation-graph': ['./src/index.js']
// 'relation-graph': ['babel-polyfill', './src/index.js']
},
output: {
path: path.resolve(__dirname, './dist'),
filename: 'relation-graph.min.js',
publicPath: '/dist/',
library: 'relation-graph',
libraryExport: 'default',
libraryTarget: 'umd',
umdNamedDefine: true,
// globalObject: 'typeof self !== \'undefined\' ? self : this'
},
externals: {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
},
vuex: {
root: 'Vuex',
commonjs: 'vuex',
commonjs2: 'vuex',
amd: 'vuex'
},
html2canvas: {
root: 'html2canvas',
commonjs: 'html2canvas',
commonjs2: 'html2canvas',
amd: 'html2canvas'
},
screenfull: {
root: 'screenfull',
commonjs: 'screenfull',
commonjs2: 'screenfull',
amd: 'screenfull'
}
},
resolve: {
extensions: ['.js', '.vue']
},
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
css: 'vue-style-loader!css-loader',
sass: 'vue-style-loader!css-loader!sass-loader'
},
postLoaders: {
html: 'babel-loader'
}
}
}, {
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.css$/,
use: [
'style-loader',
'css-loader',
'autoprefixer-loader'
]
}, {
test: /\.less$/,
loader: 'style-loader!css-loader!less-loader'
}, {
test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
loader: 'url-loader?limit=8192'
}]
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
}, {
plugins: [
// new VueLoaderPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
//new webpack.optimize.OccurrenceOrderPlugin(),
// new webpack.optimize.UglifyJsPlugin({
// uglifyOptions: {
// ie8: false,
// output: {
// comments: false,
// beautify: false,
// },
// mangle: {
// keep_fnames: true
// },
// compress: {
// warnings: false,
// drop_console: true
// }
// }
// })
]
})