Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6bc3cba

Browse files
Fix: remove SSR for now - until completely fixed
1 parent 35c336b commit 6bc3cba

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

‎Server/Controllers/HomeController.cs‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public class HomeController : Controller
1919
[HttpGet]
2020
public async Task<IActionResult> Index()
2121
{
22-
var prerenderResult = await Request.BuildPrerender();
23-
24-
ViewData["SpaHtml"] = prerenderResult.Html; // our <app-root /> from Angular
25-
ViewData["Title"] = prerenderResult.Globals["title"]; // set our <title> from Angular
26-
ViewData["Styles"] = prerenderResult.Globals["styles"]; // put styles in the correct place
27-
ViewData["Scripts"] = prerenderResult.Globals["scripts"]; // scripts (that were in our header)
28-
ViewData["Meta"] = prerenderResult.Globals["meta"]; // set our <meta> SEO tags
29-
ViewData["Links"] = prerenderResult.Globals["links"]; // set our <link rel="canonical"> etc SEO tags
30-
ViewData["TransferData"] = prerenderResult.Globals["transferData"]; // our transfer data set to window.TRANSFER_CACHE = {};
22+
// var prerenderResult = await Request.BuildPrerender();
23+
24+
// ViewData["SpaHtml"] = prerenderResult.Html; // our <app-root /> from Angular
25+
// ViewData["Title"] = prerenderResult.Globals["title"]; // set our <title> from Angular
26+
// ViewData["Styles"] = prerenderResult.Globals["styles"]; // put styles in the correct place
27+
// ViewData["Scripts"] = prerenderResult.Globals["scripts"]; // scripts (that were in our header)
28+
// ViewData["Meta"] = prerenderResult.Globals["meta"]; // set our <meta> SEO tags
29+
// ViewData["Links"] = prerenderResult.Globals["links"]; // set our <link rel="canonical"> etc SEO tags
30+
// ViewData["TransferData"] = prerenderResult.Globals["transferData"]; // our transfer data set to window.TRANSFER_CACHE = {};
3131

3232
return View();
3333
}

‎Views/Home/Index.cshtml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
@Html.Raw(ViewData["SpaHtml"])
1+
<!-- @Html.Raw(ViewData["SpaHtml"]) -->
2+
3+
<app-root></app-root>
24

35
<script src="~/dist/vendor.js" asp-append-version="true"></script>
46
@section scripts {

‎webpack.config.js‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ module.exports = (env) => {
5959
] : [
6060
// new BundleAnalyzerPlugin(),
6161
// Plugins that apply in production builds only
62-
new webpack.optimize.UglifyJsPlugin(),
62+
// new webpack.optimize.UglifyJsPlugin(),
6363
new AngularCompilerPlugin({
64-
tsConfigPath: './tsconfig.json',
65-
entryModule: path.join(__dirname, 'ClientApp/app/app.module.browser#AppModule'),
66-
exclude: ['./**/*.server.ts']
64+
mainPath: path.join(__dirname, 'ClientApp/boot.browser.ts'),
65+
tsConfigPath: './tsconfig.json',
66+
entryModule: path.join(__dirname, 'ClientApp/app/app.module.browser#AppModule'),
67+
exclude: ['./**/*.server.ts']
6768
})
6869
]),
6970
devtool: isDevBuild ? 'cheap-eval-source-map' : false,
@@ -96,15 +97,16 @@ module.exports = (env) => {
9697
{}
9798
)
9899
].concat(isDevBuild ? [] : [
99-
new webpack.optimize.UglifyJsPlugin({
100-
compress: false,
101-
mangle: false
102-
}),
100+
// new webpack.optimize.UglifyJsPlugin({
101+
// compress: false,
102+
// mangle: false
103+
// }),
103104
// Plugins that apply in production builds only
104105
new AngularCompilerPlugin({
105-
tsConfigPath: './tsconfig.json',
106-
entryModule: path.join(__dirname, 'ClientApp/app/app.module.server#AppModule'),
107-
exclude: ['./**/*.browser.ts']
106+
mainPath: path.join(__dirname, 'ClientApp/boot.server.ts'),
107+
tsConfigPath: './tsconfig.json',
108+
entryModule: path.join(__dirname, 'ClientApp/app/app.module.server#AppModule'),
109+
exclude: ['./**/*.browser.ts']
108110
})
109111
]),
110112
output: {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /