Skip to content
代码片段 群组 项目
未验证 提交 1b93e319 编辑于 作者: Thomas Hutterer's avatar Thomas Hutterer 提交者: GitLab
浏览文件

Add vite file watcher ignore config

This makes sure we only watch relevant files and avoids the
"number of file watchers reached" issues seen on Linux systems.

With a custom function we can stop vite from starting recursing down
the whole root folder. This makes the whole thing way more efficient.

We use config/vite.json to define additional paths we want watched.
上级 7989011e
No related branches found
No related tags found
无相关合并请求
{
"all": {
"sourceCodeDir": "app/assets",
"watchAdditionalPaths": [
"app/graphql/queries",
"app/assets",
"ee/app/assets",
"jh/app/assets",
"vendor/assets"
],
"entrypointsDir": "javascripts/entrypoints",
"port": 3038,
"publicOutputDir": "vite-dev",
......
......@@ -128,5 +128,21 @@ export default defineConfig({
protocol: 'ws',
},
https: false,
watch: {
ignored: [
'**/*.stories.js',
function ignoreRootFolder(x) {
/*
`vite` watches the root folder of gitlab and all of its sub folders
This is not what we want, because we have temp files, and all kind
of other stuff. As vite starts its watchers recursively, we just
ignore if the path matches exactly the root folder
Additional folders like `ee/app/assets` are defined in
*/
return x === __dirname;
},
],
},
},
});
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册