3

vue 如何让所有资源打包到一个文件呢

 2 years ago
source link: https://www.v2ex.com/t/825673
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Vue.js

vue 如何让所有资源打包到一个文件呢

  hujun528 · 1 天前 · 752 次点击
我用 webpack 在 没有使用 VUE 的项目,可以将 JS 、CSS 打包到一个 html 中,但在 vue cli 创建的项目中,同样的配置却没有效果
5 条回复    2022-01-02 17:42:15 +08:00

dream4ever

dream4ever      1 天前

可以先说说你为什么要这么做,也许最后会发现有其他更好的解决方案。

lybcyd

lybcyd      1 天前 via Android

打包到一个 HTML ,指的是文件内容变成内联,而不是外部引用?

hujun528

hujun528      1 天前

@lybcyd 对,我写某个平台的插件,但是只允许插件使用一个 html 文件,js 、css 什么的都要写这在里面

lybcyd

lybcyd      21 小时 19 分钟前

@hujun528 新建一个 vue.config.js ,用 chainwebpack 把你使用的插件加进去

zhw2590582

zhw2590582      16 小时 40 分钟前

假如没有那种路由异步加载的资源的话,直接写个简单的 nodejs 脚本手动插入

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK