commit | author | age
|
7ee3f4
|
1 |
const CopyWebpackPlugin = require('copy-webpack-plugin'); |
Z |
2 |
const cssAppend = require('./css.append.js'); |
|
3 |
const we7Append = require('./we7.append.js'); |
|
4 |
const removeOtiose = require('./remove.otiose.js'); |
|
5 |
const noPlugins = require('./no.plugins.js'); |
|
6 |
const path = require('path'); |
|
7 |
const configExtra = require('./config.extra.js'); |
|
8 |
let copyPlugin = [ |
|
9 |
{ |
|
10 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
11 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, '') |
|
12 |
}, |
|
13 |
{ |
|
14 |
from: path.join(__dirname, 'src/version.js'), |
|
15 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, '') |
|
16 |
}, |
|
17 |
{ |
|
18 |
from: path.join(__dirname, 'src/sitemap.json'), |
|
19 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, '') |
|
20 |
}, |
|
21 |
{ |
|
22 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
23 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/app_admin/siteinfo.js') |
|
24 |
}, |
|
25 |
{ |
|
26 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
27 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/card/siteinfo.js') |
|
28 |
}, |
|
29 |
{ |
|
30 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
31 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/coupon/siteinfo.js') |
|
32 |
}, |
|
33 |
{ |
|
34 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
35 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/advance/siteinfo.js') |
|
36 |
}, |
|
37 |
{ |
|
38 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
39 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/community/siteinfo.js') |
|
40 |
}, |
|
41 |
{ |
|
42 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
43 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/book/siteinfo.js') |
|
44 |
}, |
|
45 |
{ |
|
46 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
47 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/step/siteinfo.js') |
|
48 |
}, |
|
49 |
{ |
|
50 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
51 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/bargain/siteinfo.js') |
|
52 |
}, |
|
53 |
{ |
|
54 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
55 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/flash_sale/siteinfo.js') |
|
56 |
}, |
|
57 |
{ |
|
58 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
59 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/exchange/siteinfo.js') |
|
60 |
}, |
|
61 |
{ |
|
62 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
63 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/gift/siteinfo.js') |
|
64 |
}, |
|
65 |
{ |
|
66 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
67 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/integral_mall/siteinfo.js') |
|
68 |
}, |
|
69 |
{ |
|
70 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
71 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/miaosha/siteinfo.js') |
|
72 |
}, |
|
73 |
{ |
|
74 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
75 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/pick/siteinfo.js') |
|
76 |
}, |
|
77 |
{ |
|
78 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
79 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/pt/siteinfo.js') |
|
80 |
}, |
|
81 |
{ |
|
82 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
83 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/mch/mch/siteinfo.js') |
|
84 |
}, |
|
85 |
{ |
|
86 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
87 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/wholesale/siteinfo.js') |
|
88 |
}, |
|
89 |
{ |
|
90 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
91 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/mch/siteinfo.js') |
|
92 |
}, |
|
93 |
{ |
|
94 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
95 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/vip_card/siteinfo.js') |
|
96 |
}, |
|
97 |
{ |
|
98 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
99 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/siteinfo.js') |
|
100 |
}, |
|
101 |
{ |
|
102 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
103 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/order/siteinfo.js') |
|
104 |
}, |
|
105 |
{ |
|
106 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
107 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/user-center/siteinfo.js') |
|
108 |
}, |
|
109 |
{ |
|
110 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
111 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/share/siteinfo.js') |
|
112 |
}, |
|
113 |
{ |
|
114 |
from: path.join(__dirname, 'src/siteinfo.js'), |
|
115 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/goods-edit/siteinfo.js') |
|
116 |
}, |
|
117 |
{ |
|
118 |
from: path.join(__dirname, 'src/pages/address/json/name.json'), |
|
119 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/address/json/name.json') |
|
120 |
}, |
|
121 |
{ |
|
122 |
from: path.join(__dirname, 'src/pages/goods/image'), |
|
123 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/goods/image') |
|
124 |
}, |
|
125 |
{ |
|
126 |
from: path.join(__dirname, 'src/pages/favorite/image'), |
|
127 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/favorite/image') |
|
128 |
}, |
|
129 |
{ |
|
130 |
from: path.join(__dirname, 'src/pages/card/image'), |
|
131 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/card/image') |
|
132 |
}, |
|
133 |
{ |
|
134 |
from: path.join(__dirname, 'src/pages/balance/image'), |
|
135 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/balance/image') |
|
136 |
}, |
|
137 |
{ |
|
138 |
from: path.join(__dirname, 'src/pages/foot/image'), |
|
139 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/foot/image') |
|
140 |
}, |
|
141 |
{ |
|
142 |
from: path.join(__dirname, 'src/pages/share/image'), |
|
143 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/share/image') |
|
144 |
}, |
|
145 |
{ |
|
146 |
from: path.join(__dirname, 'src/pages/app_admin/image'), |
|
147 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/app_admin/image') |
|
148 |
}, |
|
149 |
{ |
|
150 |
from: path.join(__dirname, 'src/pages/app_admin/image'), |
|
151 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/app_admin/image') |
|
152 |
}, |
|
153 |
{ |
|
154 |
from: path.join(__dirname, 'src/pages/goods-edit/image'), |
|
155 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/goods-edit/image') |
|
156 |
}, |
|
157 |
{ |
|
158 |
from: path.join(__dirname, 'src/pages/member/image'), |
|
159 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/member/image') |
|
160 |
}, |
|
161 |
{ |
|
162 |
from: path.join(__dirname, 'src/pages/coupon/image'), |
|
163 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/coupon/image') |
|
164 |
}, |
|
165 |
{ |
|
166 |
from: path.join(__dirname, 'src/pages/full_reduce/image'), |
|
167 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/full_reduce/image') |
|
168 |
}, |
|
169 |
{ |
|
170 |
from: path.join(__dirname, 'src/pages/search/image'), |
|
171 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'pages/search/image') |
|
172 |
}, |
|
173 |
{ |
|
174 |
from: path.join(__dirname, 'src/plugins/bargain/image'), |
|
175 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/bargain/image') |
|
176 |
}, |
|
177 |
{ |
|
178 |
from: path.join(__dirname, 'src/plugins/fxhb/image'), |
|
179 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/fxhb/image') |
|
180 |
}, |
|
181 |
{ |
|
182 |
from: path.join(__dirname, 'src/plugins/lottery/image'), |
|
183 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/lottery/image') |
|
184 |
}, |
|
185 |
{ |
|
186 |
from: path.join(__dirname, 'src/plugins/mch/image'), |
|
187 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/mch/image') |
|
188 |
}, |
|
189 |
{ |
|
190 |
from: path.join(__dirname, 'src/plugins/pond/image'), |
|
191 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/pond/image') |
|
192 |
}, |
|
193 |
{ |
|
194 |
from: path.join(__dirname, 'src/plugins/scratch/image'), |
|
195 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/scratch/image') |
|
196 |
}, |
|
197 |
{ |
|
198 |
from: path.join(__dirname, 'src/plugins/bonus/image'), |
|
199 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/bonus/image') |
|
200 |
}, |
|
201 |
{ |
|
202 |
from: path.join(__dirname, 'src/plugins/miaosha/image'), |
|
203 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/miaosha/image') |
|
204 |
}, |
|
205 |
{ |
|
206 |
from: path.join(__dirname, 'src/plugins/pt/image'), |
|
207 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/pt/image') |
|
208 |
}, |
|
209 |
{ |
|
210 |
from: path.join(__dirname, 'src/plugins/step/image'), |
|
211 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/step/image') |
|
212 |
}, |
|
213 |
{ |
|
214 |
from: path.join(__dirname, 'src/plugins/integral_mall/image'), |
|
215 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/integral_mall/image') |
|
216 |
}, |
|
217 |
{ |
|
218 |
from: path.join(__dirname, 'src/plugins/clerk/image'), |
|
219 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/clerk/image') |
|
220 |
}, |
|
221 |
{ |
|
222 |
from: path.join(__dirname, 'src/plugins/check_in/image'), |
|
223 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/check_in/image') |
|
224 |
}, |
|
225 |
{ |
|
226 |
from: path.join(__dirname, 'src/plugins/vip_card/image'), |
|
227 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/vip_card/image') |
|
228 |
}, |
|
229 |
{ |
|
230 |
from: path.join(__dirname, 'src/plugins/advance/image'), |
|
231 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/advance/image') |
|
232 |
}, |
|
233 |
{ |
|
234 |
from: path.join(__dirname, 'src/plugins/gift/image'), |
|
235 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/gift/image') |
|
236 |
}, |
|
237 |
{ |
|
238 |
from: path.join(__dirname, 'src/plugins/gift/css'), |
|
239 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/gift/css') |
|
240 |
}, |
|
241 |
{ |
|
242 |
from: path.join(__dirname, 'src/plugins/quick_share/image'), |
|
243 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/quick_share/image') |
|
244 |
}, |
|
245 |
{ |
|
246 |
from: path.join(__dirname, 'src/plugins/stock/image'), |
|
247 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/stock/image') |
|
248 |
}, |
|
249 |
{ |
|
250 |
from: path.join(__dirname, 'src/plugins/pick/image'), |
|
251 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/pick/image') |
|
252 |
}, |
|
253 |
{ |
|
254 |
from: path.join(__dirname, 'src/plugins/region/image'), |
|
255 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/region/image') |
|
256 |
}, |
|
257 |
{ |
|
258 |
from: path.join(__dirname, 'src/plugins/community/image'), |
|
259 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/community/image') |
|
260 |
}, |
|
261 |
{ |
|
262 |
from: path.join(__dirname, 'src/plugins/flash_sale/image'), |
|
263 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/flash_sale/image') |
|
264 |
}, |
|
265 |
{ |
|
266 |
from: path.join(__dirname, 'src/plugins/exchange/image'), |
|
267 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/exchange/image') |
|
268 |
}, |
|
269 |
{ |
|
270 |
from: path.join(__dirname, 'src/plugins/composition/image'), |
|
271 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/composition/image') |
|
272 |
}, |
|
273 |
{ |
|
274 |
from: path.join(__dirname, 'src/plugins/wholesale/image'), |
|
275 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/wholesale/image') |
|
276 |
}, |
|
277 |
{ |
|
278 |
from: path.join(__dirname, 'src/plugins/demo/static'), |
|
279 |
to: path.join(__dirname, 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'plugins/demo/static') |
|
280 |
}, |
|
281 |
]; |
|
282 |
copyPlugin = copyPlugin.concat(configExtra.copy); |
|
283 |
|
|
284 |
module.exports = { |
|
285 |
configureWebpack: { |
|
286 |
plugins: [ |
|
287 |
new CopyWebpackPlugin(copyPlugin), |
|
288 |
cssAppend, |
|
289 |
we7Append, |
|
290 |
removeOtiose, |
|
291 |
noPlugins, |
|
292 |
], |
|
293 |
externals: configExtra.externals |
|
294 |
} |
|
295 |
}; |