forked from dekkerglen/CubeCobra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
193 lines (189 loc) · 8.41 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
185
186
187
188
189
190
191
192
193
const path = require('path');
const merge = require('webpack-merge');
const nodeExternals = require('webpack-node-externals');
const config = {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules[\/\\](?!react-dnd|dnd-core)/,
use: {
loader: 'babel-loader',
options: {
configFile: path.resolve(__dirname, 'babel.config.js'),
},
},
},
{
test: /\.(css|less)$/,
use: ['style-loader', 'css-loader'],
},
],
},
devtool: 'source-map',
resolve: {
modules: ['src', 'node_modules'],
},
};
const clientConfig = merge(config, {
entry: {
BlogPostPage: './src/pages/BlogPostPage.js',
BulkUploadPage: './src/pages/BulkUploadPage.js',
CubeSamplePackPage: './src/pages/CubeSamplePackPage.js',
CubeAnalysisPage: './src/pages/CubeAnalysisPage.js',
CubeBlogPage: './src/pages/CubeBlogPage.js',
CubeComparePage: './src/pages/CubeComparePage.js',
CubeDeckPage: './src/pages/CubeDeckPage.js',
CubeDecksPage: './src/pages/CubeDecksPage.js',
CubeDeckbuilderPage: './src/pages/CubeDeckbuilderPage.js',
CubeDraftPage: './src/pages/CubeDraftPage.js',
CubeListPage: './src/pages/CubeListPage.js',
CubeOverviewPage: './src/pages/CubeOverviewPage.js',
CubePlaytestPage: './src/pages/CubePlaytestPage.js',
DashboardPage: './src/pages/DashboardPage.js',
GridDraftPage: './src/pages/GridDraftPage.js',
DevBlog: './src/pages/DevBlog.js',
ContactPage: './src/pages/ContactPage.js',
DonatePage: './src/pages/DonatePage.js',
InfoPage: './src/pages/InfoPage.js',
FiltersPage: './src/pages/FiltersPage.js',
DownTimePage: './src/pages/DownTimePage.js',
ErrorPage: './src/pages/ErrorPage.js',
CardSearchPage: './src/pages/CardSearchPage.js',
TopCardsPage: './src/pages/TopCardsPage.js',
CardPage: './src/pages/CardPage.js',
CommentPage: './src/pages/CommentPage.js',
LoginPage: './src/pages/LoginPage.js',
RegisterPage: './src/pages/RegisterPage.js',
LostPasswordPage: './src/pages/LostPasswordPage.js',
NotificationsPage: './src/pages/NotificationsPage.js',
PasswordResetPage: './src/pages/PasswordResetPage.js',
UserAccountPage: './src/pages/UserAccountPage.js',
UserBlogPage: './src/pages/UserBlogPage.js',
UserDecksPage: './src/pages/UserDecksPage.js',
UserSocialPage: './src/pages/UserSocialPage.js',
UserCubePage: './src/pages/UserCubePage.js',
ExplorePage: './src/pages/ExplorePage.js',
SearchPage: './src/pages/SearchPage.js',
RecentDraftsPage: './src/pages/RecentDraftsPage.js',
VersionPage: './src/pages/VersionPage.js',
LandingPage: './src/pages/LandingPage.js',
AdminDashboardPage: './src/pages/AdminDashboardPage.js',
CommentReportsPage: './src/pages/CommentReportsPage.js',
ApplicationsPage: './src/pages/ApplicationsPage.js',
AdminCommentsPage: './src/pages/AdminCommentsPage.js',
ApplicationPage: './src/pages/ApplicationPage.js',
CreatorsPage: './src/pages/CreatorsPage.js',
MarkdownPage: './src/pages/MarkdownPage.js',
EditArticlePage: './src/pages/EditArticlePage.js',
ArticlePage: './src/pages/ArticlePage.js',
ReviewArticlesPage: './src/pages/ReviewArticlesPage.js',
ArticlesPage: './src/pages/ArticlesPage.js',
EditVideoPage: './src/pages/EditVideoPage.js',
VideoPage: './src/pages/VideoPage.js',
ReviewVideosPage: './src/pages/ReviewVideosPage.js',
VideosPage: './src/pages/VideosPage.js',
EditPodcastPage: './src/pages/EditPodcastPage.js',
PodcastPage: './src/pages/PodcastPage.js',
ReviewPodcastsPage: './src/pages/ReviewPodcastsPage.js',
PodcastsPage: './src/pages/PodcastsPage.js',
PodcastEpisodePage: './src/pages/PodcastEpisodePage.js',
BrowseContentPage: './src/pages/BrowseContentPage.js',
},
output: {
filename: '[name].bundle.js',
sourceMapFilename: '[name].js.map',
path: path.resolve(__dirname, 'dist'),
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
});
const serverConfig = merge(config, {
target: 'node',
entry: {
'pages/DashboardPage': './src/pages/DashboardPage.js',
'pages/DevBlog': './src/pages/DevBlog.js',
'pages/Loading': './src/pages/Loading.js',
'pages/BlogPostPage': './src/pages/BlogPostPage.js',
'pages/BulkUploadPage': './src/pages/BulkUploadPage.js',
'pages/CubeAnalysisPage': './src/pages/CubeAnalysisPage.js',
'pages/CubeBlogPage': './src/pages/CubeBlogPage.js',
'pages/CubeComparePage': './src/pages/CubeComparePage.js',
'pages/CubeDeckPage': './src/pages/CubeDeckPage.js',
'pages/CubeDeckbuilderPage': './src/pages/CubeDeckbuilderPage.js',
'pages/CubeDecksPage': './src/pages/CubeDecksPage.js',
'pages/CubeDraftPage': './src/pages/CubeDraftPage.js',
'pages/CubeListPage': './src/pages/CubeListPage.js',
'pages/CubeOverviewPage': './src/pages/CubeOverviewPage.js',
'pages/CubePlaytestPage': './src/pages/CubePlaytestPage.js',
'pages/CubeSamplePackPage': './src/pages/CubeSamplePackPage.js',
'pages/GridDraftPage': './src/pages/GridDraftPage.js',
'pages/ContactPage': './src/pages/ContactPage.js',
'pages/InfoPage': './src/pages/InfoPage.js',
'pages/DonatePage': './src/pages/DonatePage.js',
'pages/DownTimePage': './src/pages/DownTimePage.js',
'pages/FiltersPage': './src/pages/FiltersPage.js',
'pages/ErrorPage': './src/pages/ErrorPage.js',
'pages/CardSearchPage': './src/pages/CardSearchPage.js',
'pages/TopCardsPage': './src/pages/TopCardsPage.js',
'pages/CardPage': './src/pages/CardPage.js',
'pages/CommentPage': './src/pages/CommentPage.js',
'pages/LoginPage': './src/pages/LoginPage.js',
'pages/RegisterPage': './src/pages/RegisterPage.js',
'pages/LostPasswordPage': './src/pages/LostPasswordPage.js',
'pages/NotificationsPage': './src/pages/NotificationsPage.js',
'pages/PasswordResetPage': './src/pages/PasswordResetPage.js',
'pages/UserAccountPage': './src/pages/UserAccountPage.js',
'pages/UserBlogPage': './src/pages/UserBlogPage.js',
'pages/UserDecksPage': './src/pages/UserDecksPage.js',
'pages/UserSocialPage': './src/pages/UserSocialPage.js',
'pages/UserCubePage': './src/pages/UserCubePage.js',
'pages/ExplorePage': './src/pages/ExplorePage.js',
'pages/SearchPage': './src/pages/SearchPage.js',
'pages/RecentDraftsPage': './src/pages/RecentDraftsPage.js',
'pages/VersionPage': './src/pages/VersionPage.js',
'pages/LandingPage': './src/pages/LandingPage.js',
'pages/AdminDashboardPage': './src/pages/AdminDashboardPage.js',
'pages/CommentReportsPage': './src/pages/CommentReportsPage.js',
'pages/ApplicationsPage': './src/pages/ApplicationsPage.js',
'pages/AdminCommentsPage': './src/pages/AdminCommentsPage.js',
'pages/ApplicationPage': './src/pages/ApplicationPage.js',
'pages/CreatorsPage': './src/pages/CreatorsPage.js',
'pages/MarkdownPage': './src/pages/MarkdownPage.js',
'pages/ArticlePage': './src/pages/ArticlePage.js',
'pages/EditArticlePage': './src/pages/EditArticlePage.js',
'pages/ReviewArticlesPage': './src/pages/ReviewArticlesPage.js',
'pages/ArticlesPage': './src/pages/ArticlesPage.js',
'pages/VideoPage': './src/pages/VideoPage.js',
'pages/EditVideoPage': './src/pages/EditVideoPage.js',
'pages/ReviewVideosPage': './src/pages/ReviewVideosPage.js',
'pages/VideosPage': './src/pages/VideosPage.js',
'pages/PodcastPage': './src/pages/PodcastPage.js',
'pages/EditPodcastPage': './src/pages/EditPodcastPage.js',
'pages/ReviewPodcastsPage': './src/pages/ReviewPodcastsPage.js',
'pages/PodcastsPage': './src/pages/PodcastsPage.js',
'pages/PodcastEpisodePage': './src/pages/PodcastEpisodePage.js',
'pages/BrowseContentPage': './src/pages/BrowseContentPage.js',
'utils/Card': './src/utils/Card.js',
'utils/draftutil': './src/utils/draftutil.js',
'utils/Draft': './src/utils/Draft.js',
'filtering/FilterCards': './src/filtering/FilterCards.js',
'utils/Sort': './src/utils/Sort.js',
'utils/Util': './src/utils/Util.js',
'utils/deckutils': './src/utils/deckutils.js',
},
output: {
filename: '[name].js',
sourceMapFilename: '[name].js.map',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2',
},
externals: [
nodeExternals({
whitelist: ['react-tag-input', 'react-dnd', 'dnd-core', 'react-dnd-html5-backend', 'react-dnd-touch-backend'],
}),
],
});
module.exports = { clientConfig, serverConfig };