We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
react-hot-loader 已经生效,但是还是有些地方不方便 实际在开发同构渲染项目,感觉热更新还是有些不好使,开发效率很容易降低,具体体现在:
<h1 className="title">Script22</h1> <p /* 新增新的class */> Scripting page template in `/client/script/index.jsx`, visit via url `/script` </p> /* N 行已有代码,略 */
似乎对服务端已渲染后节点,添加className, 客户端会仍然选择服务端渲染顺序的样式
The text was updated successfully, but these errors were encountered:
className 修改后,热更新肯定是生效了的,样式有关的热更新问题是 css 无法热替换导致的,这是 使用了extract-text-plugin 后导致的 相关issue: webpack-contrib/extract-text-webpack-plugin#30
extract-text-plugin
可以考虑升级到 mini-css-extract-plugin,后者有提供HMR的计划 webpack-contrib/mini-css-extract-plugin#34
Sorry, something went wrong.
dev模式下:css-loader + style-loader build时再extract-text? 可行性高吗
css-loader
style-loader
extract-text
增加配置参数,判断是否使用 extract-text-plugin,这个实现起来没什么难度。
但是会额外提高理解成本,并且页面模板也需要区分 dev,判断是否 link css文件,这部分是要用户自己修改的。dev和线上相当于是两套逻辑,也会有不可预知的风险存在
嗯。所以next.js自己封装了
No branches or pull requests
react-hot-loader 已经生效,但是还是有些地方不方便
实际在开发同构渲染项目,感觉热更新还是有些不好使,开发效率很容易降低,具体体现在:
似乎对服务端已渲染后节点,添加className, 客户端会仍然选择服务端渲染顺序的样式
The text was updated successfully, but these errors were encountered: