修改 .dumirc.ts 下的 publicPath 不生效 #2218
Unanswered
wulisensen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Node v20.16.0
"dumi": "2.2.13"
除了 publicPath ,outputPath 能生效, codeSplitting 不生效,有没有 一些调试办法?
`ts
import { defineConfig } from 'dumi';
import px2rem from 'postcss-plugin-px2rem';
export default defineConfig({
outputPath: 'docs-dist',
publicPath: 'auto',
themeConfig: {
name: 'rm-design',
defaultPlatform: 'h5',
nav: [
{
title: '指南',
link: 'guide/start',
},
{
title: '组件',
link: 'components/nav-bar',
},
],
noIndexPage: false,
hd: {
rules: [],
},
},
theme: {
'@hd': '2px',
},
mfsu: false,
history: {
type: 'hash',
},
// 主题打包注入;
lessLoader: {
modifyVars: {
// Napos 开这里
// hack: 'true;@import "packages/cook-unify-mobile/src/style/themes/default.less"',
// 轩辕开这里
// hack: 'true;@import "packages/cook-unify-mobile/src/style/themes/xuanyuan.less"',
},
javascriptEnabled: true,
},
resolve: {
docDirs: ['docs'],
atomDirs: [
{ type: 'component', dir: 'packages/rm-mobile/src/components' },
],
},
// 别名库配置
alias: {
demos:
${process.cwd()}/packages/rm-mobile/src/demos/index.ts
,'@ali/napos-weex-mobile': '@ali/napos-weex-mobile/2x',
'@alife/cook-unify-mobile': '@alife/cook-unify-mobile/2x',
'@alife/rm-mobile$':
process.env.NODE_ENV === 'development'
? '@alife/rm-mobile'
: '@alife/rm-mobile/2x/esm',
},
presets: ['@alife/dumi-preset-gemini'],
extraPostCSSPlugins: [
(root, options) => {
if (
//h5/|napos-weex-mobile|cook-unify-mobile|cook-unify-icons|rm-mobile/.test(
root.source.input.from,
)
) {
px2rem({
rootValue: 100,
})(root, options);
}
},
],
});
`
Beta Was this translation helpful? Give feedback.
All reactions