@flatjs/evolve 1.8.1-next.71 → 1.8.1-next.72

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @flatjs/evolve
2
2
 
3
+ ## 1.8.1-next.72
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a6e5c4: improved `mock` add it to `watcherOption` ignore list
8
+ - Updated dependencies [2a6e5c4]
9
+ - @flatjs/mock@1.8.1-next.59
10
+
3
11
  ## 1.8.1-next.71
4
12
 
5
13
  ### Patch Changes
@@ -14,7 +14,8 @@ export const defaultEvolveOptions = {
14
14
  middlewares: [],
15
15
  watchOptions: {
16
16
  poll: 1000,
17
- ignored: /node_modules/,
17
+ // Use array here, easy can add a new ignore dynamic at runtime.
18
+ ignored: ['**/node_modules', '**/mocks'],
18
19
  aggregateTimeout: 500,
19
20
  },
20
21
  defaultServeGlobalData: () => Promise.resolve({}),
@@ -1,4 +1,4 @@
1
- import { loadMockConfig } from '@flatjs/mock';
1
+ import { loadMockConfig, getMockCwd } from '@flatjs/mock';
2
2
  import _ from 'lodash';
3
3
  export const refreshEvolveMockOptions = async (projectCwd, evolveOptions, configLoaderOptions) => {
4
4
  const devServer = evolveOptions.devServer;
@@ -18,6 +18,12 @@ export const refreshEvolveMockOptions = async (projectCwd, evolveOptions, config
18
18
  if (devServer.mockOptions && !devServer.mockOptions.https) {
19
19
  devServer.mockOptions.https = devServer?.https;
20
20
  }
21
+ // Dynamic resolve mock work root directory
22
+ const mockCwd = getMockCwd(newMockOptions);
23
+ // always push mockCwd into watchOptions ignored.
24
+ if (Array.isArray(devServer?.watchOptions?.ignored)) {
25
+ devServer?.watchOptions?.ignored.push(mockCwd);
26
+ }
21
27
  }
22
28
  return evolveOptions;
23
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.8.1-next.71",
3
+ "version": "1.8.1-next.72",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "@flatjs/evolve-preset-babel": "1.8.1-next.15",
47
47
  "@flatjs/forge-postcss-plugin-pixel": "1.8.1-next.30",
48
48
  "@flatjs/graph": "1.8.1-next.36",
49
- "@flatjs/mock": "1.8.1-next.58",
49
+ "@flatjs/mock": "1.8.1-next.59",
50
50
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
51
51
  "@types/babel__core": "7.20.1",
52
52
  "babel-loader": "9.1.2",