1 | const path = require('path');
|
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
|
3 | const HighCdnWebpackPlugin = require('./src/high-cdn-webpack-plugin').default;
|
4 |
|
5 | module.exports = {
|
6 | mode: 'production',
|
7 | devtool: 'none',
|
8 | entry: './src/high-cdn-webpack-plugin.js',
|
9 | output: {
|
10 | filename: '[name].js',
|
11 | path: path.resolve(__dirname, 'dist'),
|
12 | globalObject: 'this',
|
13 | libraryTarget: 'umd'
|
14 | },
|
15 | optimization : {
|
16 | minimize: false |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | }
|
34 | ,
|
35 | plugins: [new HtmlWebpackPlugin({
|
36 | template: 'public/index.html'
|
37 | }), new HighCdnWebpackPlugin({
|
38 | template: 'index.html',
|
39 | js: [
|
40 | {
|
41 | external: {
|
42 | 'vue': 'Vue'
|
43 | },
|
44 | path: 'https://cdn.staticfile.org/vue/2.5.16/vue.min.js',
|
45 | replacementPath: 'https://cdn.bootcdn.net/ajax/libs/vue/3.0.11/vue.cjs.min.js'
|
46 | },
|
47 | {
|
48 | external: {
|
49 | 'vue-router': 'VueRouter',
|
50 | },
|
51 | path: 'https://cdn.staticfile.org/vue-router/3.0.1/vue-router2.min.js',
|
52 | replacementPath: 'https://cdn.bootcdn.net/ajax/libs/vue-router/4.0.6/vue-router.cjs.js'
|
53 | },
|
54 | ],
|
55 | css: ['https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.1/theme-chalk/index.min.css']
|
56 | })]
|
57 | }; |
\ | No newline at end of file |