Test Failed
Push — master ( bbdab8...28d97f )
by Florian
04:57 queued 02:15
created

build/webpack.config.js   A

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 71
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 71
rs 10
c 3
b 0
f 0
wmc 0
mnd 0
bc 0
fnc 0
bpm 0
cpm 0
noi 1
1
const path = require('path');
2
const webpack = require("webpack");
0 ignored issues
show
Unused Code introduced by
The constant webpack seems to be never used. Consider removing it.
Loading history...
3
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
4
5
module.exports = {
6
	watch: true,
7
	watchOptions: {
8
		ignored: /node_modules/
9
	},
10
	entry: {
11
		'vue-comments': './src/install.js',
12
		'vue-comments.min': './src/install.js'
13
	},
14
	output: {
15
		filename: "[name].js",
16
		path: path.resolve(__dirname, '../dist'),
17
		library: 'VueComments',
18
		libraryTarget: 'umd'
19
	},
20
	externals: {
21
		Vuex: 'Vuex',
22
		Vue: 'Vue',
23
		axios: 'axios',
24
		VeeValidate: 'VeeValidate'
25
	},
26
	module: {
27
		rules: [
28
			{
29
				test: /\.js$/,
30
				exclude: /(node_modules|bower_components)/,
31
				use: {
32
					loader: 'babel-loader',
33
					options: {
34
						presets: ['env']
35
					}
36
				}
37
			},
38
			{
39
				test: /\.vue$/,
40
				loader: 'vue-loader',
41
				options: {
42
					loaders: {
43
						js: 'babel-loader'
44
					}
45
				}
46
			},
47
			{
48
				test: /\.(html)$/,
49
				use: {
50
					loader: 'html-loader',
51
					options: {
52
						attrs: [':data-src']
53
					}
54
				}
55
			}
56
		]
57
	},
58
	devtool: "source-map",
59
	plugins: [
60
		new UglifyJsPlugin({
61
			include: /\.min\.js$/,
62
			uglifyOptions: {
63
				ecma: 6,
64
				output: {
65
					comments: false,
66
					beautify: false
67
				},
68
			}
69
		})
70
	]
71
};
72