Skip to content

Commit

Permalink
fix: issue with SSR hot reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Oct 28, 2021
1 parent 36b8f47 commit 0bc4321
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function renderAssets(out) {



const _marko_componentType = "wUwFs+xe",
const _marko_componentType = "l8KG0xVe",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function renderAssets(out) {



const _marko_componentType = "wUwFs+xe",
const _marko_componentType = "l8KG0xVe",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function renderAssets(out) {



const _marko_componentType = "8XgZ/c27",
const _marko_componentType = "6kM99PmO",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "testruntime";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function renderAssets(out) {



const _marko_componentType = "8XgZ/c27",
const _marko_componentType = "6kM99PmO",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "testruntime";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function renderAssets(out) {



const _marko_componentType = "r9oeuJMR",
const _marko_componentType = "eUlE9/XD",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function renderAssets(out) {



const _marko_componentType = "r9oeuJMR",
const _marko_componentType = "eUlE9/XD",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function renderAssets(out) {



const _marko_componentType = "qMMCl8/W",
const _marko_componentType = "5odrrw/E",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down Expand Up @@ -366,7 +366,7 @@ function renderAssets(out) {



const _marko_componentType = "FRgaW2aC",
const _marko_componentType = "bXcWU3T1",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down Expand Up @@ -503,7 +503,7 @@ function renderAssets(out) {



const _marko_componentType = "vyXF8r3F",
const _marko_componentType = "LMt52weS",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function renderAssets(out) {



const _marko_componentType = "qMMCl8/W",
const _marko_componentType = "5odrrw/E",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down Expand Up @@ -292,7 +292,7 @@ function renderAssets(out) {



const _marko_componentType = "FRgaW2aC",
const _marko_componentType = "bXcWU3T1",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down Expand Up @@ -434,7 +434,7 @@ function renderAssets(out) {



const _marko_componentType = "vyXF8r3F",
const _marko_componentType = "LMt52weS",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function renderAssets(out) {



const _marko_componentType = "xbStr3Q2",
const _marko_componentType = "davWuRny",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function renderAssets(out) {



const _marko_componentType = "xbStr3Q2",
const _marko_componentType = "davWuRny",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function renderAssets(out) {



const _marko_componentType = "ntnz89r6",
const _marko_componentType = "m9fvJeia",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function renderAssets(out) {



const _marko_componentType = "ntnz89r6",
const _marko_componentType = "m9fvJeia",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function renderAssets(out) {



const _marko_componentType = "xGHmCIBi",
const _marko_componentType = "xfzq196l",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.___renderAssets = renderAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function renderAssets(out) {



const _marko_componentType = "xGHmCIBi",
const _marko_componentType = "xfzq196l",
_marko_component = {};
_marko_template._ = marko_dist_runtime_components_renderer__WEBPACK_IMPORTED_MODULE_7___default()(function (input, out, _component, component, state) {
out.global.runtimeId = "_marko_webpack";
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ for (const [version, webpack] of Object.entries({ webpack4, webpack5 })) {
test(`${name}`, async () => {
const fixtureDir = path.join(fixturesDir, name);
const snapshotDir = path.join(fixtureDir, "__snapshots__", version);
await fs.promises.mkdir(snapshotDir, { recursive: true });
const remainingSnapshots = fs.readdirSync(snapshotDir);
const configPath = path.join(fixtureDir, "webpack.config.ts");
const { outputPath, outputFS, stats } = await compilation(
Expand Down
4 changes: 2 additions & 2 deletions src/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default async function (
pluginOptions.runtimeId,
compiler.options.output.publicPath
),
resourcePath,
resourcePath.replace(/\.marko$/, "-server-entry.marko"),
baseConfig
);

Expand Down Expand Up @@ -242,7 +242,7 @@ function getTrailingContent(
}
}

if (ctx.hot) {
if (ctx.hot && ctx.resourceQuery !== "?browser-entry") {
result += "\nif (import.meta.webpackHot) import.meta.webpackHot.accept()";
}

Expand Down

0 comments on commit 0bc4321

Please sign in to comment.