-
Notifications
You must be signed in to change notification settings - Fork 70
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
[Refactor]: Document #618
[Refactor]: Document #618
Conversation
* fix: ssr document mode error * chore: add test case * fix: midway plugin ssr * feat: support getInitialData * fix: page component getInitial props in spa * chore: add window fallback * chore: optimize code
@@ -79,7 +79,9 @@ module.exports = function (api) { | |||
// Remove outputDir when start devServer | |||
const { outputDir = 'build' } = userConfig; | |||
configs.forEach((config) => { | |||
fs.emptyDirSync(path.resolve(rootDir, outputDir, config.name)); | |||
if (config.name) { |
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.
加一下注释
export default class LocalBuilderPlugin { | ||
apply(compiler) { | ||
compiler.hooks.shouldEmit.tap(PLUGIN_NAME, (compilation) => { | ||
emit(compilation.assets); |
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.
注释加一下
const { appConfig } = options || {}; | ||
if (!appConfig.router) { | ||
appConfig.router = {}; | ||
} | ||
appConfig.router.type = 'static'; | ||
return renderInServer(context, props, options); | ||
return await renderInServer(context, props, options); |
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.
核对一下变动
@@ -79,7 +79,9 @@ module.exports = function (api) { | |||
// Remove outputDir when start devServer | |||
const { outputDir = 'build' } = userConfig; | |||
configs.forEach((config) => { | |||
fs.emptyDirSync(path.resolve(rootDir, outputDir, config.name)); | |||
if (config.name) { |
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.
内置任务哪个链路不会设置 name?
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.
document 没设置,我设置下也行
packages/plugin-rax-web/package.json
Outdated
"chalk": "^4.1.0", | ||
"html-minifier": "^4.0.0", | ||
"cheerio": "1.0.0-rc.3" | ||
"webpack": "^4.0.0", |
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.
这个依赖应该是可以移除的,底层 build-scripts 已经依赖了,如果 plugin-rax-web 有用到内置 webpack 插件的,可以从 context 上取
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.
已删除,是之前的依赖
let localBuildTask = registerListenTask(); | ||
|
||
compiler.hooks.emit.tapAsync(PLUGIN_NAME, async (compilation, callback) => { | ||
localBuildTask.then((localBuildAssets) => { |
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.
localBuildTask 是不是可以在 emit 阶段获取最新的
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.
是的
* chore: bump version * fix: data prefetches do not decamelize (#616) * [Refactor]: Document (#618) * chore: bump version * feat: support mpa spm (#591) * feat: support global css file in mpa (#592) * refactor: enhance ssr in SPA mode (#590) * fix: ssr document mode error * chore: add test case * fix: midway plugin ssr * feat: support getInitialData * fix: page component getInitial props in spa * chore: add window fallback * chore: optimize code * feat: support no document * feat: add document builder * chore: add local build plugin * chore: add emit * feat: no document with staticExport * feat: support hash in ssr * chore: revert example * chore: optimize code * chore: remove useless code * fix: app json content watch (#612) * Bump version (#620) * chore: bump version * chore: add changelog * chore: update version * chore: update version Co-authored-by: 岭伊 <zhengwang2314@gmail.com>
src/app.js