mirror of
https://github.com/langgenius/dify.git
synced 2026-01-03 21:17:09 +00:00
feat: support import img by alias
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
.bg {
|
||||
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 React from 'react'
|
||||
import s from '@edition/sub/sub-c.module.css'
|
||||
import cn from '@/utils/classnames'
|
||||
|
||||
const Test: FC = () => {
|
||||
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)
|
||||
|
||||
@@ -106,7 +106,7 @@ const editionPaths = (() => {
|
||||
walk(fullPath)
|
||||
} else if (supportPostfixReg.test(file)) {
|
||||
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, '')}`
|
||||
result[key] = fullPathWithoutPrefix
|
||||
if (key.endsWith('/index')) {
|
||||
@@ -124,7 +124,7 @@ const editionPaths = (() => {
|
||||
return result
|
||||
})()
|
||||
|
||||
console.log(JSON.stringify(editionPaths, null, 2))
|
||||
// console.log(JSON.stringify(editionPaths, null, 2))
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
|
||||
@@ -33,7 +33,11 @@
|
||||
"@edition/*": [
|
||||
"./app/edition/saas/*",
|
||||
"./app/edition/community/*",
|
||||
]
|
||||
],
|
||||
"~@edition/*": [
|
||||
"./app/edition/saas/*",
|
||||
"./app/edition/community/*",
|
||||
],
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
|
||||
Reference in New Issue
Block a user