Comments (7)
O(∩_∩)O
我是这么追溯的
先看到这个文件的绝对路径 被core下面的config的 normalizeUserCompilationConfig 方法 放在了 config.runtime.plugins里面
然后 整个 normalizeUserCompilationConfig 返回的 config 对象都会被 Compiler 函数编译
然后 我打开Compiler定义的地方,主要用到了BindingCompiler类 编译config对象
再看BindingCompiler类 加载的是这个了 nativeBinding = require('./farm.win32-arm64-msvc.node')
我推测 ./farm.win32-arm64-msvc.node 是rust生成 的 但我不知道具体代码在哪
于是我无法在packages/runtime-plugin-hmr/src/index这个文件判断从哪拿到define: {
HMR_PORT: 9001
}
希望得到大哥指教
from farm.
最近我在看这块的代码 我发现这个hmr 的port 好像是能自定义的 我打印了一下在控制台 我能问一下是不是我理解错了,搞清楚问题 然后看能不能做一下这个
Recently, I was looking at this code and I noticed that the port of this HMR seems to be customizable. I printed it on the console and wanted to ask if I misunderstood it. I need to clarify the problem and see if I can do this
from farm.
这个是 server 部分的,是支持配置的,但是 client 的是写死的,你可以看 packages/runtime-plugin-hmr
下面的代码
from farm.
哦 需要向webpack这样是吗,client的 在devServer下新增一个 Client配置对象,然后下面有port ,host 属性可配置
from farm.
配置就是这样呢,只不过这个配置没有同步到 client 那一侧。我理解加一个 define 配置就可以实现这个功能了。
define: {
HMR_PORT: 9001
}
在 runtime plugin hmr 里面:
const port = HMR_PORT;
from farm.
直接在 packages/runtime-plugin-hmr/src/index
中些 const port = HMR_PORT
就好了,编译时会自动注入
from farm.
或许 Boolean 也需要支持一下
from farm.
Related Issues (20)
- Constructor Decorators fail to parse HOT 7
- Vue Lazy loading no work, initial page request all chunk HOT 4
- ✨ [Feature]: Svelte Support HOT 4
- No error thrown when dynamic load resources fail for a SPA
- unplugin-vue-router HOT 3
- HMR fail when there are compilation error with one module and then update another module
- [Bug Report]: Cannot read properties of undefined (reading 'accept')
- [Bug Report]: HMR Failure When Modifying CSS Files HOT 3
- [Bug Report]: process is not define
- When a React project changes the components of a router, it does not trigger the HMR and requires a manual refresh or restart HOT 2
- [Bug Report]: use vite plugin Hmr fails
- [Bug Report]: Occasional build failure after multiple build
- Vite hook "transformIndexHtml" which is not supported by Farm. HOT 2
- Provide universal JavaScript Api
- [Bug Report]: Refreshing the page causes network requests and compilation failures to occur occasionally HOT 1
- Is top-level await supported? HOT 2
- Lazy compilation issue when modify url and refresh page manully after a lazy compile
- 更新一下微信群的二维码 HOT 2
- I got an error when i installed @farmfe/js-plugin-less HOT 1
- vite-tsconfig-paths compatibility HOT 2
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 farm.