mirror of
https://github.com/langgenius/dify.git
synced 2026-04-19 13:27:17 +08:00
feat: support import img by alias
This commit is contained in:
parent
4637435e42
commit
b3a4721815
@ -1,3 +1,21 @@
|
|||||||
.bg {
|
.bg {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bgImg {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-repeat: left center;
|
||||||
|
background-image: url(~@/app/components/develop/secret-key/assets/play.svg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgCopied {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-repeat: left center;
|
||||||
|
background-image: url(../copied.svg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgCopied2 {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-repeat: left center;
|
||||||
|
background-image: url(~@edition/copied.svg);
|
||||||
|
}
|
||||||
|
|||||||
@ -2,10 +2,15 @@
|
|||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import s from '@edition/sub/sub-c.module.css'
|
import s from '@edition/sub/sub-c.module.css'
|
||||||
|
import cn from '@/utils/classnames'
|
||||||
|
|
||||||
const Test: FC = () => {
|
const Test: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className={s.bg}>SaaS</div>
|
<>
|
||||||
|
<div className={cn(s.bgImg, 'pl-4')}>SaaS</div>
|
||||||
|
<div className={cn(s.bgCopied, 'pl-4')}>Copied</div>
|
||||||
|
<div className={cn(s.bgCopied2, 'pl-4')}>Import svg use alias</div>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default React.memo(Test)
|
export default React.memo(Test)
|
||||||
|
|||||||
@ -106,7 +106,7 @@ const editionPaths = (() => {
|
|||||||
walk(fullPath)
|
walk(fullPath)
|
||||||
} else if (supportPostfixReg.test(file)) {
|
} else if (supportPostfixReg.test(file)) {
|
||||||
const relPath = path.relative(editionDir, fullPath)
|
const relPath = path.relative(editionDir, fullPath)
|
||||||
const key = `@edition/${relPath.replace(/\\/g, '/')}`.replace(/\.(ts|tsx|css)$/, '')
|
const key = `@edition/${relPath.replace(/\\/g, '/')}`.replace(supportPostfixReg, '')
|
||||||
const fullPathWithoutPrefix = `./${fullPath.replace(supportPostfixReg, '')}`
|
const fullPathWithoutPrefix = `./${fullPath.replace(supportPostfixReg, '')}`
|
||||||
result[key] = fullPathWithoutPrefix
|
result[key] = fullPathWithoutPrefix
|
||||||
if (key.endsWith('/index')) {
|
if (key.endsWith('/index')) {
|
||||||
@ -124,7 +124,7 @@ const editionPaths = (() => {
|
|||||||
return result
|
return result
|
||||||
})()
|
})()
|
||||||
|
|
||||||
console.log(JSON.stringify(editionPaths, null, 2))
|
// console.log(JSON.stringify(editionPaths, null, 2))
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
|
|||||||
@ -33,7 +33,11 @@
|
|||||||
"@edition/*": [
|
"@edition/*": [
|
||||||
"./app/edition/saas/*",
|
"./app/edition/saas/*",
|
||||||
"./app/edition/community/*",
|
"./app/edition/community/*",
|
||||||
]
|
],
|
||||||
|
"~@edition/*": [
|
||||||
|
"./app/edition/saas/*",
|
||||||
|
"./app/edition/community/*",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user