-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.common.js
184 lines (183 loc) · 9.3 KB
/
webpack.common.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: {
// security
'security/actions': './src/components/security/actions.js',
'security/methods': './src/components/security/methods.js',
'security/reducers': './src/components/security/reducers.js',
'security/constants': './src/components/security/constants.js',
'security/session-checker': './src/components/security/session-checker/op-session-checker.js',
'security/abstract-auth-callback-route': './src/components/security/abstract-auth-callback-route.js',
// components
'components/index': './src/components',
'components/ajaxloader': './src/components/ajaxloader/index.js',
'components/circle-button': './src/components/circle-button/index.js',
'components/form-validation': './src/components/form-validation/index.js',
'components/forms/rsvp-form': './src/components/forms/rsvp-form.js',
'components/forms/simple-form': './src/components/forms/simple-form.js',
'components/free-text-search': './src/components/free-text-search/index.js',
'components/google-map': './src/components/google-map/index.js',
'components/raw-html': './src/components/raw-html/index.js',
'components/sections/panel': './src/components/sections/panel.js',
'components/simple-link-list': './src/components/simple-link-list/index.js',
'components/summit-dropdown': './src/components/summit-dropdown/index.js',
'components/table': './src/components/table/Table.js',
'components/table-editable': './src/components/table-editable/EditableTable.js',
'components/table-selectable': './src/components/table-selectable/SelectableTable.js',
'components/table-sortable': './src/components/table-sortable/SortableTable.js',
'components/attendance-tracker': './src/components/attendance-tracker.js',
'components/clock': './src/components/clock.js',
'components/exclusive-wrapper': './src/components/exclusive-wrapper.js',
'components/video-stream': './src/components/video-stream.js',
'components/inputs/action-dropdown': './src/components/inputs/action-dropdown/index.js',
'components/inputs/datetimepicker': './src/components/inputs/datetimepicker/index.js',
'components/inputs/grouped-dropdown': './src/components/inputs/grouped-dropdown/index.js',
'components/inputs/upload-input': './src/components/inputs/upload-input/index.js',
'components/inputs/upload-input-v2': './src/components/inputs/upload-input-v2/index.js',
'components/inputs/access-levels-input': './src/components/inputs/access-levels-input.js',
'components/inputs/checkbox-list': './src/components/inputs/checkbox-list.js',
'components/inputs/company-input': './src/components/inputs/company-input.js',
'components/inputs/promocode-input': './src/components/inputs/promocode-input.js',
'components/inputs/country-dropdown': './src/components/inputs/country-dropdown.js',
'components/inputs/country-input': './src/components/inputs/country-input.js',
'components/inputs/dropdown': './src/components/inputs/dropdown.js',
'components/inputs/editor-input': './src/components/inputs/editor-input/index.js',
'components/inputs/event-input': './src/components/inputs/event-input.js',
'components/inputs/free-multi-text-input': './src/components/inputs/free-multi-text-input.js',
'components/inputs/group-input': './src/components/inputs/group-input.js',
'components/inputs/language-input': './src/components/inputs/language-input.js',
'components/inputs/member-input': './src/components/inputs/member-input.js',
'components/inputs/attendee-input': './src/components/inputs/attendee-input.js',
'components/inputs/operator-input': './src/components/inputs/operator-input.js',
'components/inputs/organization-input': './src/components/inputs/organization-input.js',
'components/inputs/radio-list': './src/components/inputs/radio-list.js',
'components/inputs/speaker-input': './src/components/inputs/speaker-input.js',
'components/inputs/sponsor-input': './src/components/inputs/sponsor-input.js',
'components/inputs/summit-input': './src/components/inputs/summit-input.js',
'components/inputs/tag-input': './src/components/inputs/tag-input.js',
'components/inputs/text-input': './src/components/inputs/text-input.js',
'components/inputs/textarea-input': './src/components/inputs/textarea-input.js',
'components/inputs/registration-company-input':'./src/components/inputs/registration-company-input.js',
'components/inputs/ticket-types-input':'./src/components/inputs/ticket-types-input.js',
'components/extra-questions': './src/components/extra-questions/index.js',
'components/sponsored-project-input' : './src/components/inputs/sponsored-project-input.js',
'components/schedule-builder-view' : './src/components/schedule-builder-view/index.js',
'components/schedule-builder-constants' : './src/components/schedule-builder-view/constants.js',
'components/inputs/summit-days-select' : './src/components/inputs/summit-days-select.js',
'components/inputs/summit-venues-select' : './src/components/inputs/summit-venues-select.js',
'components/inputs/stepped-select' : './src/components/inputs/stepped-select/index.jsx',
'components/bulk-actions-selector' : './src/components/bulk-actions-selector/index.js',
'components/progressive-img': './src/components/progressive-img/index.js',
// models
'models/index': './src/models',
'models/summit-event' : './src/models/summit-event.js',
//utils
'utils/fragment-parser': './src/components/fragment-parser.js',
'utils/use-fit-text': './src/components/use-fit-text.js',
'utils/actions': './src/utils/actions.js',
'utils/methods': './src/utils/methods.js',
'utils/query-actions': './src/utils/query-actions.js',
'utils/reducers': './src/utils/reducers.js',
'i18n': './src/i18n/i18n.js',
'utils/questions-set': './src/utils/questions-set.js'
},
output: {
path: path.resolve(__dirname, 'lib'),
filename: '[name].js',
library: 'openstack-uicore-foundation',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: 'this',
clean: true
},
plugins: [
new MiniCssExtractPlugin({
filename: 'css/[name].css',
}),
],
resolve: {
fallback: {
"fs" : false,
"crypto" : false,
"react-google-maps" : false,
"react-final-form" : false,
}
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
"@babel/preset-env",
{"targets": {"node": "current"}}
],
'@babel/preset-react',
'@babel/preset-flow'
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
]
}
}
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.less/,
use: [MiniCssExtractPlugin.loader, "css-loader", "less-loader"]
},
{
test: /\.module\.scss/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
modules: true,
sourceMap: false
}
},
{
loader: 'sass-loader',
options: {
sourceMap: false
}
}
]
},
{
test: /\.scss/,
exclude: /\.module\.scss/,
use: [MiniCssExtractPlugin.loader, "css-loader", 'sass-loader']
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: "url-loader?limit=10000&minetype=application/font-woff&name=fonts/[name].[ext]"
},
{
test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: "file-loader?name=fonts/[name].[ext]"
},
{
test: /\.(jpg|png|svg)$/,
type: 'asset/inline'
},
{
test: /\.yaml$/,
use: 'js-yaml-loader',
}
]
},
externals: [nodeExternals()]
};