@flatjs/evolve 1.8.1-next.62 → 1.8.1-next.64

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @flatjs/evolve
2
2
 
3
+ ## 1.8.1-next.64
4
+
5
+ ### Patch Changes
6
+
7
+ - a83ed82: Add missed config options `maxSize` parameters
8
+ - @flatjs/graph@1.8.1-next.34
9
+
10
+ ## 1.8.1-next.63
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [bf24a46]
15
+ - @flatjs/mock@1.8.1-next.52
16
+
3
17
  ## 1.8.1-next.62
4
18
 
5
19
  ### Patch Changes
@@ -1 +1 @@
1
- import{dirname,join,relative,resolve}from"node:path";import{FONT_PATH_REGEX,IMAGE_PATH_REGEX}from"./constants.js";import{isIconSvg}from"./rule-utils.js";const getEntryAssetFileName=(e,t,r)=>{const[n,s]=t,{projectCwd:o,projectVirtualPath:i}=r;let a=dirname(join(i,e.replace(/^src/,"")));const m=s.entry.map((e=>dirname(join(o,e)))),l=resolve(o,e),c=m.find((e=>l.startsWith(e)));return c&&(a=dirname(join(n,relative(c,l)))),`${a}/[name]-[contenthash:8][ext]`};export const ruleAssets=(e,t)=>({type:"asset",test:e=>FONT_PATH_REGEX.test(e)||IMAGE_PATH_REGEX.test(e)&&!isIconSvg(e),generator:{filename:({filename:r})=>getEntryAssetFileName(r,e,t)},parser:{dataUrlCondition:{maxSize:4096}}});
1
+ import{dirname,join,relative,resolve}from"node:path";import{FONT_PATH_REGEX,IMAGE_PATH_REGEX}from"./constants.js";import{isIconSvg}from"./rule-utils.js";const getEntryAssetFileName=(e,t,r)=>{const[s,n]=t,{projectCwd:a,projectVirtualPath:o}=r;let i=dirname(join(o,e.replace(/^src/,"")));const l=n.entry.map((e=>dirname(join(a,e)))),m=resolve(a,e),c=l.find((e=>m.startsWith(e)));return c&&(i=dirname(join(s,relative(c,m)))),`${i}/[name]-[contenthash:8][ext]`};export const ruleAssets=(e,t)=>({type:"asset",test:e=>FONT_PATH_REGEX.test(e)||IMAGE_PATH_REGEX.test(e)&&!isIconSvg(e),generator:{filename:({filename:r})=>getEntryAssetFileName(r,e,t)},parser:{dataUrlCondition:{maxSize:t.loaderOptions.assetDataUrlMaxSize}}});
@@ -5,5 +5,23 @@ import { type FlatEvolveOptions } from '../../types/types-options.js';
5
5
  * Preparing configurations for `less-loader`
6
6
  * @param serveMode The value indicates if we are in `built` or `serve` mode.
7
7
  * @param pluginLoaderOptions `builtin` loaders
8
+ * @example
9
+ * ```ts
10
+ * `~` makes the url an module
11
+ * webpack: {
12
+ * externals: {
13
+ * antd: 'antd',
14
+ * dayjs: 'dayjs',
15
+ * },
16
+ * resolve: {
17
+ * alias: {
18
+ * style: resolve(projectCwd, './src/style'),
19
+ * theme: resolve(projectCwd, './src/layout/theme'),
20
+ * },
21
+ * },
22
+ * },
23
+ * `@import '~theme/default.less';` at `style.less`
24
+ *
25
+ * ```
8
26
  */
9
27
  export declare const ruleLess: (serveMode: boolean, entryMapItem: EntryMapItem, evolveOptions: FlatEvolveOptions) => RuleSetRule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.8.1-next.62",
3
+ "version": "1.8.1-next.64",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -44,8 +44,8 @@
44
44
  "@flatjs/common": "1.8.1-next.28",
45
45
  "@flatjs/evolve-preset-babel": "1.8.1-next.13",
46
46
  "@flatjs/forge-postcss-plugin-pixel": "1.8.1-next.28",
47
- "@flatjs/graph": "1.8.1-next.33",
48
- "@flatjs/mock": "1.8.1-next.51",
47
+ "@flatjs/graph": "1.8.1-next.34",
48
+ "@flatjs/mock": "1.8.1-next.52",
49
49
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
50
50
  "@types/babel__core": "7.20.1",
51
51
  "babel-loader": "9.1.2",