Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 71 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | const path = require('path'); |
||
2 | const webpack = require("webpack"); |
||
|
|||
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 |