-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
子项目为create-react-app,修改任意后,主项目报错 #340
Comments
改了什么提供一下啊.. |
比如我改了react16 app.js里面的文字 |
热加载应该是关掉了吧 @Deturium 看下 |
可能是 |
试了,把 |
ping @Deturium |
我没事使用react-scripts,直接把config文件eject出来,然后把配置改成和react-scripts一样,可还是不行 |
大佬能看下我的问题么?我没有使用react-scripts,而是直接把config文件eject出来,然后把配置改成和react-scripts一样,可还是不行 |
这个问题还确实比较头疼。。 主要 CRA 脚手架里面,除了 HMR 的热重载之外,自己还另起了一个 live reload,而这个在非 eject 下是没有办法禁止
你这里既然 eject 了那想办法把 live reload 也关了就行 |
使用
|
|
config.entry.filter is not a function |
我也遇到了这个问题,请问你解决了么? |
Has anyone figured out how to fix this? |
CRA 4.0.0.不能这样写,改一改,如下: const { name } = require("./package.json");
const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const webpack = require("webpack");
module.exports = {
webpack: function override(config, env) {
config.output.library = `${name}-[name]`;
config.output.libraryTarget = "umd";
config.output.jsonpFunction = `webpackJsonp_${name}`;
// Remove 'react-refresh' from the loaders.
for (const rule of config.module.rules) {
if (!rule.oneOf) continue;
for (const one of rule.oneOf) {
if (one.loader && one.loader.includes("babel-loader") && one.options && one.options.plugins) {
one.options.plugins = one.options.plugins.filter(
(plugin) => typeof plugin !== "string" || !plugin.includes("react-refresh")
);
}
}
}
config.plugins = config.plugins.filter(
(plugin) => !(plugin instanceof webpack.HotModuleReplacementPlugin) && !(plugin instanceof ReactRefreshPlugin)
);
return config;
},
devServer: (configFunction) => {
return function (proxy, allowedHost) {
const config = configFunction(proxy, allowedHost);
config.open = false;
config.hot = false;
config.headers = {
"Access-Control-Allow-Origin": "*",
};
return config;
};
},
}; 参考:https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd#gistcomment-3516287 |
This article will help you https://juejin.cn/post/6927972972640600078/ |
把端口写进去也不行,感觉应该是版本的问题,我的vue 3.0+ts是最新的版本,react 项目使用的creat-react-app + ts官方脚手架,最新版本17,安装最新的react-app-rewired 可能最新版本改动,按照const { name } = require("./package.json"); module.exports = {
}, |
What happens?
官方例子,修改react16即create-react-app项目后,主项目报错You need to export the functional lifecycles in react16 entry
Mini Showcase Repository(REQUIRED)
https://github.com/umijs/qiankun/tree/master/examples
How To Reproduce
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
Context
The text was updated successfully, but these errors were encountered: