Skip to content

serve 时监测配置文件变更 #133

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

Merged
merged 6 commits into from
May 18, 2021
Merged

serve 时监测配置文件变更 #133

merged 6 commits into from
May 18, 2021

Conversation

nighca
Copy link
Collaborator

@nighca nighca commented May 18, 2021

改动

  • 执行 serve 命令时监测配置文件是否发生变更;如发生变更,则重启服务(dev server)
  • 修复 build samples 的问题,确保 circle CI 运行正常 (挪到 修复 CI #134 做)

关于对配置文件的监测

会被 watch 的配置文件目前包括:

  1. 当前使用的 build config 文件(默认是项目根目录下的 build-config.json
  2. 项目根目录下的 tsconfig.json(如果存在的话)

image

@nighca nighca changed the base branch from master to v2 May 18, 2021 02:46
@@ -126,7 +126,7 @@ function addTransform(
}

const appendRule = (previousConfig: Configuration, ruleBase: Partial<RuleSetRule>) => produce(previousConfig, (nextConfig: Configuration) => {
const rule = makeRule(resource.include, resourcePattern, contextPattern, ruleBase)
const rule = makeRule(extension, resourcePattern, contextPattern, ruleBase)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边 extensionresource.include 值是一样的,前者更合适一点

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nip: 上面 119 行的一起替换下? include: makeExtensionPattern(resource.include)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看下

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 47285c1

@nighca nighca changed the title 检测配置文件变更 serve 时监测配置文件变更 May 18, 2021
Copy link
Collaborator

@liaoyu liaoyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤪

@nighca nighca merged commit 4e2054c into qiniu:v2 May 18, 2021

### watch build config change

不是痛点,低优先级处理

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果只改 dev proxy 配置的时候
可以只重启 dev server
就完美了

@nighca nighca mentioned this pull request Aug 27, 2021
nighca added a commit that referenced this pull request Aug 27, 2021
* sv

* without svg

* use file & svgr for svg

* typo

* samples change

* update config

* dev deps & script

* optimize svg support

* drop support for ENV_VARIABLES_FILE

* sv

* update samples

* debug devServer route fallback & module resolution

* enable ts-loader allowTsInNodeModules

* update details

* update README

* extract css

* optimization.addPolyfill

* use asset module instead of loaders

* optimize deps

* update TODO

* beta.1

* throw error in logLifecycle

* beta.2

* upload

* beta.3

* beta.4

* disable svgo for svg transform

* beta.5

* 支持 extractCommon & extractVendor (#2)

* extractCommon & extractVendor

* default vendors

* fix extractVendor

* remove build-config.md

* fix review

* fix extractVendor

* tsconfig 配置调整 (#4)

* open esModuleInterop

* target to es6

* 调整默认的目标浏览器 (#3)

* adjust default target browsers

* use svgr for qiniu portal

* npm audit

* filter ts-loader transpileOnly warning

* beta.7

* 新增 analyze 命令以分析 bundle 依赖 (#132)

* add analyz

* add analyze command

* fix self review

* fix review

* 修复 CI (#134)

* debug build-sample.sh

* debug samples for CI

* update browserslist db

* update circle ci node versions

* serve 时监测配置文件变更 (#133)

* watch build config file change

* typo

* watch for tsconfig.json

* remove useless code

* comment

* typo

* 修复样式修改 hot reload 不生效的问题 (#135)

* fix css hot reload

* optimize env logic

* beta.8

* Upgrade typescript 4.1.x (#137)

* use typescript 4.1.x

* beta.9

* log pretty (#138)

* beta.10

* source map 行为优化 (#139)

* process source map

* beta.11

* upgrade ts-loader

* typo

* use cheap-module-source-map instead of eval-source-map

* move webpack-related fns to utils/webpack

* build-config 支持 npm package 作为 `extends` 目标 (#140)

* support npm package as extends target

* update build-config doc

* support file in npm package

* beta.12

* 支持 `optimization.compressImage` (#142)

* remove sourcemap from TODO

* update build script

* specify webpack config target

* update comment for getServeConfig

* add repository info in package.json

* update command prepare & test

* optimization.compressImage

* update samples

* beta.13

* fix dynamic-import (#143)

* beta.14

* fix Typescript moduleResolution (#144)

* beta.15

Co-authored-by: liaoyu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants