1 | const path = require('path');
|
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
|
3 | const CdnWebpackPlugin = require('./src/cdn-webpack-plugin');
|
4 |
|
5 |
|
6 | module.exports = {
|
7 | mode: 'production',
|
8 | devtool: 'none',
|
9 | entry: './src/cdn-webpack-plugin.js',
|
10 | output: {
|
11 | filename: '[name].bundle.js',
|
12 | path: path.resolve(__dirname, 'dist')
|
13 | },
|
14 | plugins: [new HtmlWebpackPlugin({
|
15 | template: 'public/index.html'
|
16 | }), new CdnWebpackPlugin({
|
17 | template: 'index.html',
|
18 | js: [
|
19 | {
|
20 | external: {
|
21 | 'vue': 'Vue'
|
22 | },
|
23 | path: 'https://cdn.staticfile.org/vue/2.5.16/vue.min.js',
|
24 | replacementPath: 'https://cdn.bootcdn.net/ajax/libs/vue/3.0.11/vue.cjs.min.js'
|
25 | },
|
26 | {
|
27 | external: {
|
28 | 'vue-router': 'VueRouter',
|
29 | },
|
30 | path: 'https://cdn.staticfile.org/vue-router/3.0.1/vue-router2.min.js',
|
31 | replacementPath: 'https://cdn.bootcdn.net/ajax/libs/vue-router/4.0.6/vue-router.cjs.js'
|
32 | },
|
33 | ],
|
34 | css: ['https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.1/theme-chalk/index.min.css']
|
35 | })]
|
36 | }; |
\ | No newline at end of file |