-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restart dev server when tsconfig and tailwind config changes (#…
…4947) * First run * Works with tailwind! * Added TSConfig to watchlist * Changeset * Fix eslint * Renamed `isConfigReload` --> `isRestart` and `injectWatchTarget` --> `addWatchFile` * Refactored watchTargets to watchFiles * Refactor createSettings * addWatchFile now accepts URL * Fix getViteConfig * Expanded description of the change Co-authored-by: Matthew Phillips <matthew@skypack.dev>
- Loading branch information
Showing
11 changed files
with
129 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
- Added `isRestart` and `addWatchFile` to integration step `isRestart`. | ||
- Restart dev server automatically when tsconfig changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@astrojs/tailwind': minor | ||
--- | ||
|
||
## HMR on config file changes | ||
|
||
New in this release is the ability for config changes to automatically reflect via HMR. Now when you edit your `tsconfig.json` or `tailwind.config.js` configs, the changes will reload automatically without the need to restart your dev server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
import type { TsConfigJson } from 'tsconfig-resolver'; | ||
import type { AstroConfig, AstroSettings } from '../../@types/astro'; | ||
|
||
import jsxRenderer from '../../jsx/renderer.js'; | ||
import { loadTSConfig } from './tsconfig.js'; | ||
|
||
export interface CreateSettings { | ||
config: AstroConfig; | ||
tsConfig?: TsConfigJson; | ||
tsConfigPath?: string; | ||
} | ||
export function createSettings(config: AstroConfig, cwd?: string): AstroSettings { | ||
const tsconfig = loadTSConfig(cwd); | ||
|
||
export function createSettings({ config, tsConfig, tsConfigPath }: CreateSettings): AstroSettings { | ||
return { | ||
config, | ||
tsConfig, | ||
tsConfigPath, | ||
tsConfig: tsconfig?.config, | ||
tsConfigPath: tsconfig?.path, | ||
|
||
adapter: undefined, | ||
injectedRoutes: [], | ||
pageExtensions: ['.astro', '.md', '.html'], | ||
renderers: [jsxRenderer], | ||
scripts: [], | ||
watchFiles: tsconfig?.exists ? [tsconfig.path, ...tsconfig.extendedPaths] : [], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters