| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  | /* | 
					
						
							| 
									
										
										
										
											2019-04-10 02:39:42 +08:00
										 |  |  |  * MinIO Cloud Storage (C) 2016 MinIO, Inc. | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  |  * you may not use this file except in compliance with the License. | 
					
						
							|  |  |  |  * You may obtain a copy of the License at | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *     http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  |  * distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  |  * See the License for the specific language governing permissions and | 
					
						
							|  |  |  |  * limitations under the License. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var webpack = require('webpack') | 
					
						
							|  |  |  | var path = require('path') | 
					
						
							| 
									
										
										
										
											2019-01-09 03:04:59 +08:00
										 |  |  | var glob = require('glob-all') | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  | var CopyWebpackPlugin = require('copy-webpack-plugin') | 
					
						
							| 
									
										
										
										
											2019-01-09 03:04:59 +08:00
										 |  |  | var PurgecssPlugin = require('purgecss-webpack-plugin') | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | var exports = { | 
					
						
							|  |  |  |   context: __dirname, | 
					
						
							| 
									
										
										
										
											2019-01-09 03:04:59 +08:00
										 |  |  |   mode: 'development', | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |   entry: [ | 
					
						
							|  |  |  |     path.resolve(__dirname, 'app/index.js') | 
					
						
							|  |  |  |   ], | 
					
						
							|  |  |  |   output: { | 
					
						
							|  |  |  |     path: path.resolve(__dirname, 'dev'), | 
					
						
							|  |  |  |     filename: 'index_bundle.js', | 
					
						
							|  |  |  |     publicPath: '/minio/' | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   module: { | 
					
						
							| 
									
										
										
										
											2018-01-29 14:47:00 +08:00
										 |  |  |     rules: [{ | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |         test: /\.js$/, | 
					
						
							|  |  |  |         exclude: /(node_modules|bower_components)/, | 
					
						
							| 
									
										
										
										
											2018-01-29 14:47:00 +08:00
										 |  |  |         use: [{ | 
					
						
							|  |  |  |           loader: 'babel-loader', | 
					
						
							|  |  |  |           options: { | 
					
						
							|  |  |  |             presets: ['react', 'es2015'] | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         }] | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       }, { | 
					
						
							|  |  |  |         test: /\.less$/, | 
					
						
							| 
									
										
										
										
											2018-01-29 14:47:00 +08:00
										 |  |  |         use: [{ | 
					
						
							|  |  |  |           loader: 'style-loader' | 
					
						
							|  |  |  |         }, { | 
					
						
							|  |  |  |           loader: 'css-loader' | 
					
						
							|  |  |  |         }, { | 
					
						
							|  |  |  |           loader: 'less-loader' | 
					
						
							|  |  |  |         }] | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       }, { | 
					
						
							|  |  |  |         test: /\.css$/, | 
					
						
							| 
									
										
										
										
											2018-01-29 14:47:00 +08:00
										 |  |  |         use: [{ | 
					
						
							|  |  |  |           loader: 'style-loader' | 
					
						
							|  |  |  |         }, { | 
					
						
							|  |  |  |           loader: 'css-loader' | 
					
						
							|  |  |  |         }] | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       }, { | 
					
						
							|  |  |  |         test: /\.(eot|woff|woff2|ttf|svg|png)/, | 
					
						
							| 
									
										
										
										
											2018-01-29 14:47:00 +08:00
										 |  |  |         use: [{ | 
					
						
							|  |  |  |           loader: 'url-loader' | 
					
						
							|  |  |  |         }] | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       }] | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   node:{ | 
					
						
							|  |  |  |     fs:'empty' | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   devServer: { | 
					
						
							|  |  |  |     historyApiFallback: { | 
					
						
							|  |  |  |       index: '/minio/' | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     proxy: { | 
					
						
							|  |  |  |       '/minio/webrpc': { | 
					
						
							|  |  |  | 	target: 'http://localhost:9000', | 
					
						
							|  |  |  | 	secure: false | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       '/minio/upload/*': { | 
					
						
							|  |  |  | 	target: 'http://localhost:9000', | 
					
						
							|  |  |  | 	secure: false | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       '/minio/download/*': { | 
					
						
							|  |  |  | 	target: 'http://localhost:9000', | 
					
						
							|  |  |  | 	secure: false | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2017-02-23 06:51:38 +08:00
										 |  |  |       '/minio/zip': { | 
					
						
							|  |  |  |         target: 'http://localhost:9000', | 
					
						
							|  |  |  |         secure: false | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   plugins: [ | 
					
						
							|  |  |  |     new CopyWebpackPlugin([ | 
					
						
							|  |  |  |       {from: 'app/css/loader.css'}, | 
					
						
							| 
									
										
										
										
											2018-03-27 03:49:12 +08:00
										 |  |  |       {from: 'app/img/browsers/chrome.png'}, | 
					
						
							|  |  |  |       {from: 'app/img/browsers/firefox.png'}, | 
					
						
							|  |  |  |       {from: 'app/img/browsers/safari.png'}, | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       {from: 'app/img/logo.svg'}, | 
					
						
							| 
									
										
										
										
											2019-03-24 00:57:09 +08:00
										 |  |  |       {from: 'app/img/favicon/favicon-16x16.png'}, | 
					
						
							|  |  |  |       {from: 'app/img/favicon/favicon-32x32.png'}, | 
					
						
							|  |  |  |       {from: 'app/img/favicon/favicon-96x96.png'}, | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |       {from: 'app/index.html'} | 
					
						
							|  |  |  |     ]), | 
					
						
							|  |  |  |     new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/), | 
					
						
							| 
									
										
										
										
											2019-01-09 03:04:59 +08:00
										 |  |  |     new PurgecssPlugin({ | 
					
						
							|  |  |  |       paths: glob.sync([ | 
					
						
							|  |  |  |         path.join(__dirname, 'app/index.html'), | 
					
						
							|  |  |  |         path.join(__dirname, 'app/js/*.js') | 
					
						
							|  |  |  |       ]) | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |     }) | 
					
						
							|  |  |  |   ] | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (process.env.NODE_ENV === 'dev') { | 
					
						
							|  |  |  |   exports.entry = [ | 
					
						
							| 
									
										
										
										
											2017-02-02 19:01:49 +08:00
										 |  |  |     'webpack-dev-server/client?http://localhost:8080', | 
					
						
							| 
									
										
										
										
											2017-01-24 10:07:22 +08:00
										 |  |  |     path.resolve(__dirname, 'app/index.js') | 
					
						
							|  |  |  |   ] | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = exports |