From c49fe70083d10779e0534dacedb9ae0687c0c0a4 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Mon, 5 Dec 2022 11:24:33 +0300 Subject: [PATCH] Fix an "export was not found" webpack warning in canvas3d.ts (#5419) The cause of the warning is explained here: https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#type-only-imports-exports Add a webpack configuration option to treat such warnings as errors, to prevent any more of them from appearing in the future. ### Motivation and context Warnings are annoying. ### How has this been tested? ### Checklist - [x] I submit my changes into the `develop` branch - ~~[ ] I have added a description of my changes into [CHANGELOG](https://github.com/cvat-ai/cvat/blob/develop/CHANGELOG.md) file~~ - ~~[ ] I have updated the [documentation]( https://github.com/cvat-ai/cvat/blob/develop/README.md#documentation) accordingly~~ - ~~[ ] I have added tests to cover my changes~~ - ~~[ ] I have linked related issues ([read github docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~ - ~~[ ] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning))~~ ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. --- cvat-canvas3d/src/typescript/canvas3d.ts | 4 +++- cvat-ui/webpack.config.js | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cvat-canvas3d/src/typescript/canvas3d.ts b/cvat-canvas3d/src/typescript/canvas3d.ts index bf03acbc..6333e23d 100644 --- a/cvat-canvas3d/src/typescript/canvas3d.ts +++ b/cvat-canvas3d/src/typescript/canvas3d.ts @@ -118,5 +118,7 @@ class Canvas3dImpl implements Canvas3d { } export { - Canvas3dImpl as Canvas3d, Canvas3dVersion, ViewType, MouseInteraction, CameraAction, ViewsDOM, Mode as CanvasMode, + Canvas3dImpl as Canvas3d, Canvas3dVersion, ViewType, MouseInteraction, CameraAction, Mode as CanvasMode, }; + +export type { ViewsDOM }; diff --git a/cvat-ui/webpack.config.js b/cvat-ui/webpack.config.js index 9c8b9485..85582d81 100644 --- a/cvat-ui/webpack.config.js +++ b/cvat-ui/webpack.config.js @@ -134,6 +134,11 @@ module.exports = (env) => ({ }, }, ], + parser: { + javascript: { + exportsPresence: 'error', + }, + }, }, plugins: [ new HtmlWebpackPlugin({