forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
142 lines (139 loc) · 7.75 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const fs = require('fs');
const config = [{
entry: {
'./htdocs/js/components/DynamicDataTable.js': './jsx/DynamicDataTable.js',
'./htdocs/js/components/PaginationLinks.js': './jsx/PaginationLinks.js',
'./htdocs/js/components/StaticDataTable.js': './jsx/StaticDataTable.js',
'./htdocs/js/components/MultiSelectDropdown.js': './jsx/MultiSelectDropdown.js',
'./htdocs/js/components/Breadcrumbs.js': './jsx/Breadcrumbs.js',
'./htdocs/js/components/Form.js': './jsx/Form.js',
'./htdocs/js/components/Markdown.js': './jsx/Markdown.js',
'./modules/media/js/mediaIndex.js': './modules/media/jsx/mediaIndex.js',
'./modules/issue_tracker/js/issueTrackerIndex.js': './modules/issue_tracker/jsx/issueTrackerIndex.js',
'./modules/issue_tracker/js/index.js': './modules/issue_tracker/jsx/index.js',
'./modules/candidate_parameters/js/CandidateParameters.js': './modules/candidate_parameters/jsx/CandidateParameters.js',
'./modules/configuration/js/SubprojectRelations.js': './modules/configuration/jsx/SubprojectRelations.js',
'./modules/conflict_resolver/js/conflictResolverIndex.js': './modules/conflict_resolver/jsx/conflictResolverIndex.js',
'./modules/conflict_resolver/js/resolvedConflictsIndex.js': './modules/conflict_resolver/jsx/resolvedConflictsIndex.js',
'./modules/bvl_feedback/js/react.behavioural_feedback_panel.js': './modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js',
'./modules/behavioural_qc/js/behavioural_qc_module.js': './modules/behavioural_qc/jsx/behavioural_qc_module.js',
'./modules/candidate_list/js/openProfileForm.js': './modules/candidate_list/jsx/openProfileForm.js',
'./modules/candidate_list/js/onLoad.js': './modules/candidate_list/jsx/onLoad.js',
'./modules/candidate_list/js/candidateListIndex.js': './modules/candidate_list/jsx/candidateListIndex.js',
'./modules/datadict/js/dataDictIndex.js': './modules/datadict/jsx/dataDictIndex.js',
'./modules/dataquery/js/react.app.js': './modules/dataquery/jsx/react.app.js',
'./modules/dataquery/js/react.fieldselector.js': './modules/dataquery/jsx/react.fieldselector.js',
'./modules/dataquery/js/react.filterBuilder.js': './modules/dataquery/jsx/react.filterBuilder.js',
'./modules/dataquery/js/react.paginator.js': './modules/dataquery/jsx/react.paginator.js',
'./modules/dataquery/js/react.sidebar.js': './modules/dataquery/jsx/react.sidebar.js',
'./modules/dataquery/js/react.tabs.js': './modules/dataquery/jsx/react.tabs.js',
'./modules/dicom_archive/js/dicom_archive.js': './modules/dicom_archive/jsx/dicom_archive.js',
'./modules/genomic_browser/js/FileUploadModal.js': './modules/genomic_browser/jsx/FileUploadModal.js',
'./modules/genomic_browser/js/profileColumnFormatter.js': './modules/genomic_browser/jsx/profileColumnFormatter.js',
'./modules/imaging_browser/js/ImagePanel.js': './modules/imaging_browser/jsx/ImagePanel.js',
'./modules/imaging_browser/js/imagingBrowserIndex.js': './modules/imaging_browser/jsx/imagingBrowserIndex.js',
'./modules/instrument_builder/js/react.instrument_builder.js': './modules/instrument_builder/jsx/react.instrument_builder.js',
'./modules/instrument_builder/js/react.questions.js': './modules/instrument_builder/jsx/react.questions.js',
'./modules/instrument_manager/js/instrumentManagerIndex.js': './modules/instrument_manager/jsx/instrumentManagerIndex.js',
'./modules/survey_accounts/js/surveyAccountsIndex.js': './modules/survey_accounts/jsx/surveyAccountsIndex.js',
'./modules/mri_violations/js/mri_protocol_check_violations_columnFormatter.js': './modules/mri_violations/jsx/mri_protocol_check_violations_columnFormatter.js',
'./modules/mri_violations/js/columnFormatter.js': './modules/mri_violations/jsx/columnFormatter.js',
'./modules/mri_violations/js/columnFormatterUnresolved.js': './modules/mri_violations/jsx/columnFormatterUnresolved.js',
'./modules/mri_violations/js/mri_protocol_violations_columnFormatter.js': './modules/mri_violations/jsx/mri_protocol_violations_columnFormatter.js',
'./modules/user_accounts/js/userAccountsIndex.js': './modules/user_accounts/jsx/userAccountsIndex.js',
'./modules/examiner/js/examinerIndex.js': './modules/examiner/jsx/examinerIndex.js',
'./modules/help_editor/js/help_editor.js': './modules/help_editor/jsx/help_editor.js',
'./modules/brainbrowser/js/Brainbrowser.js': './modules/brainbrowser/jsx/Brainbrowser.js',
'./modules/imaging_uploader/js/index.js': './modules/imaging_uploader/jsx/index.js',
'./modules/acknowledgements/js/acknowledgementsIndex.js': './modules/acknowledgements/jsx/acknowledgementsIndex.js',
'./modules/new_profile/js/NewProfileIndex.js': './modules/new_profile/jsx/NewProfileIndex.js',
'./modules/imaging_qc/js/imagingQCIndex.js': './modules/imaging_qc/jsx/imagingQCIndex.js',
'./modules/server_processes_manager/js/server_processes_managerIndex.js': './modules/server_processes_manager/jsx/server_processes_managerIndex.js',
'./modules/document_repository/js/docIndex.js': './modules/document_repository/jsx/docIndex.js',
'./modules/document_repository/js/editFormIndex.js': './modules/document_repository/jsx/editFormIndex.js',
'./modules/publication/js/publicationIndex.js': './modules/publication/jsx/publicationIndex.js',
'./modules/publication/js/viewProjectIndex.js': './modules/publication/jsx/viewProjectIndex.js',
},
output: {
path: __dirname + '/',
filename: '[name]',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader?cacheDirectory',
},
{
loader: 'eslint-loader',
options: {
cache: true,
},
},
],
enforce: 'pre',
},
{
test: /\.json$/,
loader: 'json',
},
],
},
resolve: {
alias: {
util: path.resolve(__dirname, './htdocs/js/util'),
jsx: path.resolve(__dirname, './jsx'),
Breadcrumbs: path.resolve(__dirname, './jsx/Breadcrumbs'),
DataTable: path.resolve(__dirname, './jsx/DataTable'),
DynamicDataTable: path.resolve(__dirname, './jsx/DynamicDataTable'),
Filter: path.resolve(__dirname, './jsx/Filter'),
FilterableDataTable: path.resolve(__dirname, './jsx/FilterableDataTable'),
FilterForm: path.resolve(__dirname, './jsx/FilterForm'),
Form: path.resolve(__dirname, './jsx/Form'),
Loader: path.resolve(__dirname, './jsx/Loader'),
Markdown: path.resolve(__dirname, './jsx/Markdown'),
Modal: path.resolve(__dirname, './jsx/Modal'),
MultiSelectDropdown: path.resolve(__dirname, './jsx/MultiSelectDropdown'),
PaginationLinks: path.resolve(__dirname, './jsx/PaginationLinks'),
Panel: path.resolve(__dirname, './jsx/Panel'),
ProgressBar: path.resolve(__dirname, './jsx/ProgressBar'),
StaticDataTable: path.resolve(__dirname, './jsx/StaticDataTable'),
Tabs: path.resolve(__dirname, './jsx/Tabs'),
TriggerableModal: path.resolve(__dirname, './jsx/TriggerableModal'),
},
extensions: ['*', '.js', '.jsx', '.json'],
},
externals: {
react: 'React',
},
node: {
fs: 'empty',
},
devtool: 'source-map',
plugins: [],
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
compress: false,
ecma: 6,
mangle: false,
},
sourceMap: true,
}),
],
},
}];
// Support project overrides
if (fs.existsSync('./project/webpack-project.config.js')) {
const projConfig = require('./project/webpack-project.config.js');
config[0].entry = Object.assign(config[0].entry, projConfig);
}
module.exports = config;