mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Doc] fix tree shaking when build site
This commit is contained in:
parent
8564a5b1f1
commit
6e93c93d46
@ -49,6 +49,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.less$/,
|
test: /\.less$/,
|
||||||
|
sideEffects: true,
|
||||||
use: [
|
use: [
|
||||||
'style-loader',
|
'style-loader',
|
||||||
'css-loader',
|
'css-loader',
|
||||||
@ -63,10 +64,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.md$/,
|
test: /\.md$/,
|
||||||
use: [
|
use: ['vue-loader', '@vant/markdown-loader']
|
||||||
'vue-loader',
|
|
||||||
'@vant/markdown-loader'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(ttf|svg)$/,
|
test: /\.(ttf|svg)$/,
|
||||||
|
@ -3,7 +3,9 @@ import docConfig from './doc.config';
|
|||||||
import DemoList from './components/DemoList';
|
import DemoList from './components/DemoList';
|
||||||
import DemoPages from './components/DemoPages';
|
import DemoPages from './components/DemoPages';
|
||||||
import { demoWrapper } from './demo-common';
|
import { demoWrapper } from './demo-common';
|
||||||
import './utils/iframe-router';
|
import { initIframeRouter } from './utils/iframe-router';
|
||||||
|
|
||||||
|
initIframeRouter();
|
||||||
|
|
||||||
const registerRoute = ({ mobile, componentMap }) => {
|
const registerRoute = ({ mobile, componentMap }) => {
|
||||||
const route = [
|
const route = [
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import { setLang } from './lang';
|
import { setLang } from './lang';
|
||||||
import { iframeReady, isMobile } from '.';
|
import { iframeReady, isMobile } from '.';
|
||||||
|
|
||||||
|
export function initIframeRouter() {
|
||||||
window.syncPath = function () {
|
window.syncPath = function () {
|
||||||
const router = window.vueRouter;
|
const router = window.vueRouter;
|
||||||
const isInIframe = window !== window.top;
|
const isInIframe = window !== window.top;
|
||||||
@ -32,3 +33,4 @@ window.changePath = function (lang, path = '') {
|
|||||||
setLang(lang);
|
setLang(lang);
|
||||||
window.vueRouter.replace(path);
|
window.vueRouter.replace(path);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user