Skip to content

Commit a482366

Browse files
committed
site: add site build
1 parent 9388245 commit a482366

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

components/icon/demo/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</demo-sort>
99
</template>
1010

11-
<script>
12-
import IconDisplay from '../../../theme/template/IconDisplay';
11+
<script lang="ts">
12+
import IconDisplay from '../../../site/src/theme/template/IconDisplay';
1313
import Basic from './basic.vue';
1414
import Custom from './custom.vue';
1515
import Iconfont from './iconfont.vue';

components/tree/demo/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Directory from './directory.vue';
2424
import SwitcherIcon from './switcher-icon.vue';
2525
import ReplaceFields from './replaceFields.vue';
2626
import ContextMenu from './context-menu.vue';
27-
import VirtualScroll from './virtual-scroll';
27+
import VirtualScroll from './virtual-scroll.vue';
2828
import CN from '../index.zh-CN.md';
2929
import US from '../index.en-US.md';
3030
import { defineComponent } from 'vue';

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
5252
"codecov": "codecov",
5353
"routes": "node site/scripts/genrateRoutes.js",
54-
"tsc": "tsc --noEmit"
54+
"tsc": "tsc --noEmit",
55+
"site": "yarn routes && ./node_modules/vite/bin/vite.js build site --base=https://aliyuncdn.antdv.com/v2/"
5556
},
5657
"repository": {
5758
"type": "git",

site/themeConfig.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const themeConfig = [
66
theme: 'dark',
77
htmlThemeAttr: 'dark',
88
modifyVars: {
9+
hack: `true;@import "${require.resolve('../components/style/color/colorPalette.less')}";`,
910
...defaultVars,
1011
...dark,
1112
'text-color': 'fade(@white, 65%)',
@@ -36,6 +37,8 @@ const additionalData = async (content: string, filename: string): Promise<string
3637
}
3738
return Promise.resolve(res);
3839
} catch (error) {
40+
// eslint-disable-next-line no-console
41+
console.log(error);
3942
return Promise.reject(content);
4043
}
4144
});

site/vite.config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
alias: {
1414
'@': path.join(__dirname, './src'),
1515
vue: 'vue/dist/vue.esm-bundler.js',
16+
'ant-design-vue/es': path.resolve(__dirname, '../components'),
1617
'ant-design-vue': path.resolve(__dirname, '../components'),
1718
},
1819
},
@@ -43,7 +44,10 @@ export default {
4344
css: {
4445
preprocessorOptions: {
4546
less: {
46-
modifyVars: { ...defaultVar },
47+
modifyVars: {
48+
hack: `true;@import "${require.resolve('../components/style/color/colorPalette.less')}";`,
49+
...defaultVar,
50+
},
4751
javascriptEnabled: true,
4852
// includePaths: ["node_modules/"],
4953
additionalData,

0 commit comments

Comments
 (0)