Skip to content

Commit bcfe8c5

Browse files
author
sky
committed
fix: add renderMode for entry template loader
1 parent cc77747 commit bcfe8c5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/core/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ class Config {
7878
return this._typescript;
7979
}
8080

81+
get renderMode() {
82+
if (this.config.template || this.config.target === 'web') {
83+
return 'csr';
84+
}
85+
return 'ssr';
86+
}
87+
8188
get postcss() {
8289
return this.config.postcss;
8390
}

lib/target/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class WebpackBaseBuilder extends Config {
6767
const babelrc = this.projectBabelrc ? undefined : this.babelrc;
6868
const babelOptions = this.merge(babel.options, { babelrc });
6969
const babelLoaderString = `${babel.loader}?${JSON.stringify(babelOptions)}`;
70-
const entryLoaderString = this.utils.getLoaderOptionString(loader, { templateFile });
70+
const entryLoaderString = this.utils.getLoaderOptionString(loader, { templateFile, renderMode: this.renderMode });
7171
const regMatch = match instanceof RegExp ? match : new RegExp(match);
7272
Object.keys(entries).forEach(entryName => {
7373
const entryFile = entries[entryName];

0 commit comments

Comments
 (0)