-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 适配commonjs(for ssr) 构建 #1109
Conversation
概述整体变更涉及项目结构或模块层次的重新组织。在 变更
诗歌
Note Pull Request Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://coderabbit.ai Files selected for processing (1)
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
if (lessResult) { | ||
return lessResult; | ||
} | ||
// user load first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user load first 有具体场景?比如要拦截 less 的处理?否则从功能上来看应该是一样的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dumi会有less?dumi-raw
dist
Summary by CodeRabbit
新功能
opts.config.outputPath
或默认路径的新outputPath
变量。outputPath
变量代替硬编码的路径。getOkamConfig
中引入了新的配置选项cjs
、dynamicImportToRequire
和platform
。导出或公共实体声明的更改
exports.build
函数:const outputPath = path.resolve(opts.cwd, opts.config.outputPath || 'dist');
statsJsonPath
,使用outputPath
替代硬编码的路径。exports.dev
函数:const outputPath = path.resolve(opts.cwd, opts.config.outputPath || 'dist');
app.use(express.static(...))
,使用outputPath
替代硬编码的路径。getOkamConfig
函数:let platform = 'browser'; if (webpackConfig.target === 'node') platform = 'node';
cjs
、dynamicImportToRequire
和platform
。