UNPKG

1.63 kBJavaScriptView Raw
1const path = require('path');
2const HtmlWebpackPlugin = require('html-webpack-plugin');
3const HighCdnWebpackPlugin = require('./index');
4
5module.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 splitChunks : {
18 chunks: 'all',
19 cacheGroups: {
20 libs: {
21 name: 'chunk-libs',
22 test: /[\\/]node_modules[\\/]/,
23 priority: 10,
24 chunks: 'initial'
25 },
26 cheerIO: {
27 name: 'chunk-cheerIO',
28 priority: 20,
29 test: /[\\/]node_modules[\\/]_?cheerio(.*)/
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