add version to docs path

This adds the @pybricks/ide-docs package version to the static path.
This should ensure that we don't get a cached older version in the
browser when the ide-docs package is updated.
This commit is contained in:
David Lechner
2022-07-06 14:17:53 -05:00
parent d548c20062
commit c4b0a9a781
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -601,8 +601,8 @@ module.exports = function (webpackEnv) {
new CopyPlugin({
patterns: [
{
from: 'node_modules/@pybricks/ide-docs/html',
to: 'static/docs',
from: `${path.dirname(require.resolve('@pybricks/ide-docs/package.json'))}/html`,
to: `static/docs/v${require('@pybricks/ide-docs/package.json').version}/`,
},
],
}),
+4 -3
View File
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2022 The Pybricks Authors
import 'react-splitter-layout/lib/index.css';
import './app.scss';
import { Classes } from '@blueprintjs/core';
import docsPackage from '@pybricks/ide-docs/package.json';
import { getFocusableTreeWalker } from '@react-aria/focus';
import React, {
FocusEventHandler,
@@ -20,8 +23,6 @@ import StatusBar from '../status-bar/StatusBar';
import Terminal from '../terminal/Terminal';
import Toolbar from '../toolbar/Toolbar';
import { isMacOS } from '../utils/os';
import 'react-splitter-layout/lib/index.css';
import './app.scss';
const Docs: React.VFC = () => {
const { setIsSettingShowDocsEnabled } = useSettingIsShowDocsEnabled();
@@ -119,7 +120,7 @@ const Docs: React.VFC = () => {
contentWindow.document.documentElement.classList.add(Classes.DARK);
}
}}
src="static/docs/index.html"
src={`static/docs/v${docsPackage.version}/index.html`}
allowFullScreen={true}
role="documentation"
width="100%"