-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
node_modules下的tsx也运行转义 #357
Conversation
Pull Request Test Coverage Report for Build 222
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
支持lerna HRM
@@ -68,9 +68,6 @@ export default function dev({ | |||
'access-control-allow-origin': '*', | |||
}, | |||
publicPath: webpackConfig.output.publicPath, | |||
watchOptions: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个删了会不会让 watch 有性能问题?
@@ -424,14 +424,13 @@ export default function getConfig(opts = {}) { | |||
}, | |||
{ | |||
test: /\.(js|jsx)$/, | |||
include: opts.cwd, | |||
include: [opts.cwd,/packages/], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认不要加,有可能会误伤。通过环境变量开启吧,比如 LERNA=true 时才加上 /packages/
的 include。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
想了想,这个通过 extraBabelIncludes 配就好,不要加这个逻辑了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那tsx 怎么办? 这个不在babel配置里面啊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx 下面不是删了 node_modules 的 exclude 条件了吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,对 , 这个跟watch无关
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的意思是想让tsx 也应该有watch 功能,但是watch 因为性能问题忽略掉“node_modules”,我想是不是应该跟 babel 一样,也用白名单机制, 如果不能共用extraBabelIncludes配置,只能新增配置extraTsxIncludes 这样是否可行?
https://webpack.js.org/configuration/watch/#watchoptions-ignored |
@sorrycc 那就通过白名单的方式 添加watch 文件,其实主要是在lerna 上用 |
写个最简单的 lerna 例子,贴出来,我跑跑看? |
@sorrycc 稍等 |
@sorrycc 重新修改测试了下,针对tsx , 发现只要注释代码: |
* ci: upgrade cache version * ci: use pnpm action setup
* ci: upgrade cache version * ci: use pnpm action setup
取消node_modules排除,让 tsx 也跟less一样,可以在第三方库里面载入