Skip to content

Commit 03d4710

Browse files
authored
[EEG Browser] Fix webpack and ts config (#9517)
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
1 parent 5c7b3bd commit 03d4710

File tree

2 files changed

+18
-43
lines changed

2 files changed

+18
-43
lines changed

modules/electrophysiology_browser/jsx/react-series-data-viewer/tsconfig.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

webpack.config.ts

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,27 @@ const module: webpack.ModuleOptions = {
171171
},
172172
{
173173
test: /\.tsx?$/,
174+
exclude: [/react-series-data-viewer/],
174175
use: [
175176
{
176177
loader: 'ts-loader',
177-
options: {onlyCompileBundledFiles: true},
178+
options: {
179+
onlyCompileBundledFiles: true,
180+
},
181+
},
182+
],
183+
},
184+
{
185+
test: /.*\/react-series-data-viewer\/.*\.tsx?$/,
186+
use: [
187+
{
188+
loader: 'ts-loader',
189+
options:{
190+
onlyCompileBundledFiles: true,
191+
compilerOptions: {
192+
strict: false,
193+
}
194+
}
178195
},
179196
],
180197
},
@@ -317,40 +334,4 @@ configs.push({
317334
stats: 'errors-warnings',
318335
});
319336

320-
// HACK: For some reason, the electrophysiology session view only compiles if
321-
// it uses a separate (although possibly identical) configuration.
322-
if (!target || target === 'electrophysiology_browser') {
323-
configs.push({
324-
entry: {
325-
electrophysiology_browser: {
326-
import: './modules/electrophysiology_browser/'
327-
+ 'jsx/electrophysiologySessionView',
328-
filename: './modules/electrophysiology_browser/'
329-
+ 'js/electrophysiologySessionView.js',
330-
library: {
331-
name: [
332-
'lorisjs',
333-
'electrophysiology_browser',
334-
'electrophysiologySessionView',
335-
],
336-
type: 'window',
337-
},
338-
},
339-
},
340-
output: {
341-
path: __dirname,
342-
filename: './htdocs/js/components/[name].js',
343-
library: ['lorisjs', '[name]'],
344-
libraryTarget: 'window',
345-
},
346-
externals: {'react': 'React', 'react-dom': 'ReactDOM'},
347-
devtool: 'source-map',
348-
plugins,
349-
optimization,
350-
resolve,
351-
module,
352-
stats: 'errors-warnings',
353-
});
354-
}
355-
356337
export default configs;

0 commit comments

Comments
 (0)