Skip to content

Commit

Permalink
[EEG Browser] Fix webpack and ts config (#9517)
Browse files Browse the repository at this point in the history
Fix the webpack and TS config for EEG Browser:
- disable TS strict mode for the EEG visualization module for successful
compilation
- remove unecessary webpack hack with proper ts config
  • Loading branch information
laemtl authored Dec 18, 2024
1 parent 5c7b3bd commit 03d4710
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 43 deletions.

This file was deleted.

55 changes: 18 additions & 37 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
},
],
},
Expand Down Expand Up @@ -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;

0 comments on commit 03d4710

Please sign in to comment.