Comments (5)
您现在可以根据1.0.5的改动来添加html热更新了
from webpack4_mpa_demo.
这个raw-loader
和html-loader
一起使用会有bug, 去除html-loader
后页面引入的图片路径就不会处理。我下载了你的代码,也有同样的问题!!
from webpack4_mpa_demo.
我找到了解决方法
{
test: /\.html$/,
use: [
{
loader: 'html-loader?config=raw-loader',
options: {
attrs: ['img:src']
}
},
]
}
不过这种方法只能做到刷新页面,热更新还是不行,不过好像找不到更优的方案了
from webpack4_mpa_demo.
还有index.html
文件引入的时候要区分开发环境,不然打包的时候会把html打包到js中
if (process.env.NODE_ENV !== 'production') {
require('./index.html');
}
from webpack4_mpa_demo.
感谢您的建议,已经做出修改,如果您在使用中还有好的意见或建议,可以继续提issues或者pr,再次感谢支持...
from webpack4_mpa_demo.
Related Issues (14)
- 启动报错 HOT 2
- 无法支持vue的单页面 HOT 1
- 资源配置的bug和不合理之处 HOT 1
- 修改html文件,页面不会刷新。 HOT 1
- 不兼容ie8 HOT 1
- Cannot apply update. Need to do a full reload! HOT 2
- 作为小白的疑惑。 HOT 3
- 打包后页面跳转路径错误怎么解决呢 HOT 2
- 打包之后的问题 HOT 1
- 几个问题 HOT 1
- 打包之后跳转的HTML路径不对了。404 HOT 5
- devtool HOT 1
- 有没有计划升级一下 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 webpack4_mpa_demo.