From bbf7fa387f0d5f1694dcc1b809ff826233bdbb06 Mon Sep 17 00:00:00 2001 From: laemtl Date: Wed, 18 Dec 2024 00:03:09 +0000 Subject: [PATCH] [EEG Browser] Fix webpack and ts config --- .../react-series-data-viewer/tsconfig.json | 6 -- webpack.config.ts | 55 ++++++------------- 2 files changed, 18 insertions(+), 43 deletions(-) delete mode 100644 modules/electrophysiology_browser/jsx/react-series-data-viewer/tsconfig.json diff --git a/modules/electrophysiology_browser/jsx/react-series-data-viewer/tsconfig.json b/modules/electrophysiology_browser/jsx/react-series-data-viewer/tsconfig.json deleted file mode 100644 index f158825331a..00000000000 --- a/modules/electrophysiology_browser/jsx/react-series-data-viewer/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../../../tsconfig", - "compilerOptions": { - "strict": false - } -} diff --git a/webpack.config.ts b/webpack.config.ts index 1e350381bd5..9be10e13746 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -171,10 +171,27 @@ const module: webpack.ModuleOptions = { }, { test: /\.tsx?$/, + exclude: [/react-series-data-viewer/], use: [ { loader: 'ts-loader', - options: {onlyCompileBundledFiles: true}, + options: { + onlyCompileBundledFiles: true, + }, + }, + ], + }, + { + test: /.*\/react-series-data-viewer\/.*\.tsx?$/, + use: [ + { + loader: 'ts-loader', + options:{ + onlyCompileBundledFiles: true, + compilerOptions: { + strict: false, + } + } }, ], }, @@ -317,40 +334,4 @@ configs.push({ stats: 'errors-warnings', }); -// HACK: For some reason, the electrophysiology session view only compiles if -// it uses a separate (although possibly identical) configuration. -if (!target || target === 'electrophysiology_browser') { - configs.push({ - entry: { - electrophysiology_browser: { - import: './modules/electrophysiology_browser/' - + 'jsx/electrophysiologySessionView', - filename: './modules/electrophysiology_browser/' - + 'js/electrophysiologySessionView.js', - library: { - name: [ - 'lorisjs', - 'electrophysiology_browser', - 'electrophysiologySessionView', - ], - type: 'window', - }, - }, - }, - output: { - path: __dirname, - filename: './htdocs/js/components/[name].js', - library: ['lorisjs', '[name]'], - libraryTarget: 'window', - }, - externals: {'react': 'React', 'react-dom': 'ReactDOM'}, - devtool: 'source-map', - plugins, - optimization, - resolve, - module, - stats: 'errors-warnings', - }); -} - export default configs;