@flatjs/evolve 1.8.1-next.63 → 1.8.1-next.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -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
|
|
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.
|
|
3
|
+
"version": "1.8.1-next.64",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,7 +44,7 @@
|
|
|
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.
|
|
47
|
+
"@flatjs/graph": "1.8.1-next.34",
|
|
48
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",
|