Skip to content

Commit

Permalink
feat: add support for the hydrateIncludeImprots option
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Apr 17, 2021
1 parent 8cda688 commit 788acc5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@marko/compiler": "^5.7.0",
"@marko/compiler": "^5.8.1",
"@types/jest": "^26.0.20",
"@types/loader-utils": "^2.0.1",
"@types/node": "^14.14.22",
Expand All @@ -28,7 +28,7 @@
"jest": "^26.6.3",
"jest-file-snapshot": "0.3.8",
"lint-staged": "^10.5.3",
"marko": "^5.7.0",
"marko": "^5.8.1",
"memory-fs": "^0.5.0",
"mini-css-extract-plugin": "^1.3.5",
"prettier": "^2.2.1",
Expand Down
5 changes: 5 additions & 0 deletions src/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type LoaderOptions = loaderUtils.OptionObject &
Config & {
target?: webpack.loader.LoaderContext["target"];
compiler?: string;
hydrateIncludeImports?: string | Config["hydrateIncludeImports"];
};

const WATCH_MISSING_FILES = [
Expand Down Expand Up @@ -136,6 +137,10 @@ export default async function (
}
} as Config;

if (loaderOptions.hydrateIncludeImports) {
baseConfig.hydrateIncludeImports = loaderOptions.hydrateIncludeImports;
}

if (resourceQuery === "?server-entry") {
const { code, map } = await markoCompiler.compile(
getAssetCode(
Expand Down

0 comments on commit 788acc5

Please sign in to comment.