UNPKG

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