diff --git a/index.html b/index.html index bf448cef..7357ac6f 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ Type Words 练习英语 - + + +` + return html.replace('', `${scripts}`) }, - { - name: 'vue-router', - var: 'VueRouter', - path: `https://2study.top/vue-router.global.prod.min.js` - }, - { - name: 'axios', - var: 'axios', - path: 'https://2study.top/axios.min.js' - }, - ], - }) : null + }, + viteExternalsPlugin({ + vue: 'Vue', + 'vue-router': 'VueRouter', + axios: 'axios', + }) + ] : null, ], build: { rollupOptions: { - external: ['build', 'report'].includes(lifecycle) ? ['axios'] : [],// 使用全局的 axios。因为百度翻译库内部用了0.19版本的axios,会被打包到代码里面 + external: isBuild ? ['axios'] : [],// 使用全局的 axios。因为百度翻译库内部用了0.19版本的axios,会被打包到代码里面 } }, define: {