forked from okta/okta-signin-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.common.config.js
More file actions
113 lines (106 loc) · 4.06 KB
/
Copy pathwebpack.common.config.js
File metadata and controls
113 lines (106 loc) · 4.06 KB
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
var path = require('path');
var EMPTY = 'widget/empty';
var TARGET_JS = path.resolve(__dirname, 'target/js/');
var SHARED_JS = TARGET_JS + '/shared';
// Return a function so that all consumers get a new copy of the config
module.exports = function (outputFilename) {
return {
entry: './target/js/widget/OktaSignIn.js',
output: {
path: TARGET_JS,
filename: outputFilename,
library: 'OktaSignIn',
libraryTarget: 'umd'
},
resolve: {
root: [TARGET_JS],
alias: {
// General remapping
'nls': '@okta/i18n/dist/json',
'okta/jquery': SHARED_JS + '/util/jquery-wrapper',
'okta/underscore': SHARED_JS + '/util/underscore-wrapper',
'okta/handlebars': 'handlebars/dist/handlebars',
'okta/moment': 'moment/moment',
'okta/jqueryui': EMPTY,
'okta': 'shared/util/Okta',
'shared/util/Bundles': 'util/Bundles',
// Vendor files from courage that are remapped in OSW to point to an npm
// module in our package.json dependencies
'vendor/lib/q': 'q',
'vendor/plugins/jquery.placeholder': 'jquery-placeholder',
'handlebars': 'handlebars/dist/handlebars',
'qtip': '@okta/qtip2',
// Duo has an npm module, but the latest version does not expose the
// v2 version. Continue to use the vendor file that is checked into
// source.
'duo': 'vendor/Duo-Web-v2',
// Modules from courage that we are not using. Be proactive about
// checking these - new modules need to be blacklisted here.
// Note: If the module is included relatively in the source file,
// override it in the null-loader configs below.
'jqueryui': EMPTY,
'mixpanel': EMPTY,
'selectize': EMPTY,
'shared/util/Bundle.js': EMPTY,
'shared/views/datalist/DeadSimpleDataList': EMPTY,
'shared/views/Backbone.TableView': EMPTY,
'shared/util/TabbedRouter': EMPTY,
'shared/util/DataListController': EMPTY,
'shared/views/components/BaseFormDialog': EMPTY,
'shared/views/components/BaseModalDialog': EMPTY,
'shared/views/components/ConfirmationDialog': EMPTY,
'shared/views/components/MultiViewModalDialog': EMPTY,
'shared/views/components/DropDown': EMPTY,
'shared/util/markdownToHtml': EMPTY,
'shared/util/Metrics': EMPTY,
'shared/views/wizard/BaseWizard': EMPTY
}
},
module: {
loaders: [
// Shims
{
loader: 'imports?this=>window,jQuery=jquery',
test: require.resolve('jquery-placeholder')
},
// These are courage files that are loaded with relative paths, which
// cannot be excluded using the EMPTY method above.
{
loader: 'null-loader',
include: [
'util/TimezoneUtil',
'views/Backbone.TableVie',
'views/datalist/SimpleDataList',
'views/datalist/Table',
'views/forms/inputs/GroupPicker',
'views/forms/inputs/AppPicker',
'views/forms/inputs/AppInstancePicker',
'views/forms/inputs/IdpPicker',
'views/forms/inputs/ScopesPicker',
'views/forms/inputs/SUOrgsPicker',
'views/forms/inputs/UserPicker',
'views/forms/inputs/BasePicker',
'views/forms/inputs/ZonePicker',
'views/forms/inputs/TextArea',
'views/forms/inputs/TextPlusSelect',
'views/forms/inputs/DateBox',
'views/forms/inputs/NumberBox',
'views/forms/inputs/TextSelect',
'views/forms/components/ReadModeBar',
'views/forms/inputs/ListInput',
'views/forms/inputs/SimpleCheckBoxSet'
].map(function (file) {
return path.resolve(TARGET_JS, 'shared', file);
})
}
]
},
// Webpack attempts to add a polyfill for process
// and setImmediate, because q uses process to see
// if it's in a Node.js environment
node: {
process: false,
setImmediate: false
}
};
};