Skip to content

Commit

Permalink
fix: add bundle path
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
v8tenko committed Jun 29, 2023
1 parent c1fb398 commit 5109c6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"build/head-content.js"
],
"assets": [
"node_modules/@diplodoc/client/build/app.client.js",
"node_modules/@diplodoc/client/build/app.client.css"
"build/app.client.js",
"build/app.client.css"
]
},
"keywords": [
Expand Down
6 changes: 6 additions & 0 deletions scripts/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ const path = require('path');

const CLIENT_PATH = path.dirname(require.resolve('@diplodoc/client'));
const BUILD_PATH = 'build';
const BUNDLE_PATH = '_bundle';
const BUNDLE_JS_FILENAME = 'app.client.js';
const BUNDLE_CSS_FILENAME = 'app.client.css';

const src = (target) => path.resolve(CLIENT_PATH, target);
const dst = (target) => path.resolve(BUILD_PATH, target);
const bundle = (target) => path.join('../', BUNDLE_PATH, target);


module.exports = {
Expand All @@ -18,4 +20,8 @@ module.exports = {
js: src(BUNDLE_JS_FILENAME),
css: src(BUNDLE_CSS_FILENAME),
},
bundle: {
js: bundle(BUNDLE_JS_FILENAME),
css: bundle(BUNDLE_CSS_FILENAME),
},
};
4 changes: 2 additions & 2 deletions src/utils/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function generateStaticMarkup(props: DocInnerProps<DocPageData>): string
height: 100vh;
}
</style>
<link type="text/css" rel="stylesheet" href="${client.dst.css}" />
<link type="text/css" rel="stylesheet" href="${client.bundle.css}" />
${PluginService.getHeadContent()}
${resources}
</head>
Expand All @@ -51,7 +51,7 @@ export function generateStaticMarkup(props: DocInnerProps<DocPageData>): string
window.STATIC_CONTENT = ${staticContent}
window.__DATA__ = ${JSON.stringify(props)};
</script>
<script type="application/javascript" src="${client.dst.js}"></script>
<script type="application/javascript" src="${client.bundle.js}"></script>
</body>
</html>
`;
Expand Down

0 comments on commit 5109c6d

Please sign in to comment.