Commit 0da6dd38 by xinla

cdn

1 parent b36bff03
...@@ -178,13 +178,41 @@ export default defineConfig(async ({ command, mode }) => { ...@@ -178,13 +178,41 @@ export default defineConfig(async ({ command, mode }) => {
env._ISCDN && env._ISCDN &&
vitePluginCdnImport({ vitePluginCdnImport({
// prodUrl: 'https://unpkg.com/{name}@{version}/{path}', // prodUrl: 'https://unpkg.com/{name}@{version}/{path}',
prodUrl: 'https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}',
modules: [ modules: [
// autoComplete('vue'), // autoComplete('vue'),
// autoComplete('axios'), // autoComplete('axios'),
{ {
name: 'axios', // 包名 name: 'axios', // 包名
var: 'axios', // 对应cdn包导出的变量,如jQuery导出的是$ var: 'axios', // 对应cdn包导出的变量,如jQuery导出的是$
path: '//cdn.bootcdn.net/ajax/libs/axios/1.4.0/axios.min.js', version: '1.4.0',
path: 'axios.min.js',
},
{
name: 'clipboard',
var: 'ClipboardJS',
version: '2.0.11',
path: 'https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.11/clipboard.min.js',
},
{
name: 'jsencrypt',
var: 'JSEncrypt',
version: '3.3.2',
path: 'jsencrypt.min.js',
},
{
name: 'crypto-js',
var: 'CryptoJS',
version: '4.1.1',
path: 'crypto-js.min.js',
},
{
name: 'nprogress',
var: 'NProgress',
version: '0.2.0',
path: 'nprogress.min.js',
css: 'nprogress.min.css',
}, },
// { // {
// name: 'element-plus', // name: 'element-plus',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!