Comments (3)
vue配置chunks:all,把js包含进来 。
pages: {
index: {
entry: "src/main.js",
template: "public/index.html",
filename: "index.html",
chunks:'all'
},
from vue-cli3-samples.
打包出来有很多preload
······ 网上所有的解决办法都失效了,博主可以良计?
vue-cli3 提供了inspect
可以输出实际的Webpack配置,可以看到preload
和prefetch
/* config.plugin('preload') */
new PreloadPlugin(
{
rel: 'preload',
include: 'initial',
fileBlacklist: [
/\.map$/,
/hot-update\.js$/
]
}
),
/* config.plugin('prefetch') */
new PreloadPlugin(
{
rel: 'prefetch',
include: 'asyncChunks'
}
),
去除preload只需在vue.config.js配置chainWebpack属性就行了
chainWebpack: config => {
config.plugins.delete('preload')
}
from vue-cli3-samples.
解决了,多谢博主
from vue-cli3-samples.
Related Issues (5)
- element-ui 并不能单独打包 HOT 1
- 多页面并不是一个好的方案 HOT 1
- 打包出来的page1.html和page2.html两者都引入了同样的vendor HOT 2
- 多入口打包到对应文件夹下 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli3-samples.