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