Comments (6)
dist/static/img/bg.jpg,但是我两个二级目录图片虽然同名,但是是不一样的两张图,这个为什么不能按模块来处理图片,都打包到同一个目录,名字一样就不行了
from vue-cli-multi-page.
请问解决了嘛?我也发现这个问题,不知如何修改配置
from vue-cli-multi-page.
需要在webpack针对图片的url-loader配置那里,加上hash
from vue-cli-multi-page.
@jxp4531 可以配置做到每一个页面的图片单独放一个文件夹吗?
from vue-cli-multi-page.
@634323580 解决了吗?求指教
from vue-cli-multi-page.
@MySecret @huyongyong1992 @634323580 @zuishuanglin
在webpack.base.conf.js里的
module: {
rules: [
{//这是第三个
test: /.(png|jpe?g|gif|svg)(?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: utils.assetsPath('img/[name].[ext]')
}
}
]
},里的name改成utils.assetsPath('img/[name].[hash:7].[ext]')
在打包后的每个img都会加上不同的hash,以此区分。单页面是这样处理的,此项目打包后文件均没有做缓存处理,被作者改过。
from vue-cli-multi-page.
Related Issues (20)
- 能在views 同级目录再创建模块么
- 多页面seo该如何解决? HOT 1
- 编译很慢,不知道从哪开始入手优化? HOT 2
- 公共模块问题
- 使用此项目的多页面商城,打包之后出现webpackJsonp的问题! HOT 1
- views下面的模块的二级目录 是所有模块都必须保持一致吗?
- 打包文件目录配置!
- 请求components文件夹里的公共组件怎么引用图片
- 给变量赋值总是不成功为什么 HOT 3
- 关于开发环境编译后会出现内存过大超出的问题 HOT 4
- 在Lib中使用common中的方法生产环境报不能识别,调试环境无异常
- 修改为history模式,本地测试的页面无法访问 HOT 1
- npm run build --report不会生成带版本的资源文件
- 每次npm run build版本号都会变,怎样做到只有文件改变,版本号才会变?
- npm install直接报错都不能用了
- 可以使用vuex吗? HOT 1
- 请问大家在自己公司的项目中用这个脚手架了吗?
- 请问作者还维护这个项目吗? 肿么这么没有安全感
- dist怎么没有一个根index.html,怎样进行相互的一个跳转呢
- @bluefox1688 被你的脚手架搞死了,大兄弟出来挨打!
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-cli-multi-page.