| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  | const path = require('path'); | 
					
						
							| 
									
										
										
										
											2018-06-26 16:28:37 +08:00
										 |  |  | const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | module.exports = { | 
					
						
							|  |  |  |   target: 'web', | 
					
						
							|  |  |  |   stats: { | 
					
						
							|  |  |  |     children: false | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   entry: { | 
					
						
							|  |  |  |     app: './public/app/index.ts', | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   output: { | 
					
						
							|  |  |  |     path: path.resolve(__dirname, '../../public/build'), | 
					
						
							| 
									
										
										
										
											2018-04-18 21:01:36 +08:00
										 |  |  |     filename: '[name].[hash].js', | 
					
						
							| 
									
										
										
										
											2018-05-07 23:02:55 +08:00
										 |  |  |     // Keep publicPath relative for host.com/grafana/ deployments
 | 
					
						
							| 
									
										
										
										
											2018-05-07 14:11:48 +08:00
										 |  |  |     publicPath: "public/build/", | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  |   resolve: { | 
					
						
							| 
									
										
										
										
											2018-10-10 01:46:31 +08:00
										 |  |  |     extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'], | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  |     alias: { | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     modules: [ | 
					
						
							|  |  |  |       path.resolve('public'), | 
					
						
							|  |  |  |       path.resolve('node_modules') | 
					
						
							|  |  |  |     ], | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2018-09-14 13:47:33 +08:00
										 |  |  |   stats: { | 
					
						
							|  |  |  |     warningsFilter: /export .* was not found in/ | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  |   node: { | 
					
						
							|  |  |  |     fs: 'empty', | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   module: { | 
					
						
							|  |  |  |     rules: [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: require.resolve('jquery'), | 
					
						
							|  |  |  |         use: [ | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             loader: 'expose-loader', | 
					
						
							|  |  |  |             query: 'jQuery' | 
					
						
							|  |  |  |           }, | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             loader: 'expose-loader', | 
					
						
							|  |  |  |             query: '$' | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.html$/, | 
					
						
							|  |  |  |         exclude: /index\.template.html/, | 
					
						
							|  |  |  |         use: [ | 
					
						
							| 
									
										
										
										
											2018-04-18 21:01:36 +08:00
										 |  |  |           { loader: 'ngtemplate-loader?relativeTo=' + (path.resolve(__dirname, '../../public')) + '&prefix=public' }, | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  |           { | 
					
						
							|  |  |  |             loader: 'html-loader', | 
					
						
							|  |  |  |             options: { | 
					
						
							|  |  |  |               attrs: [], | 
					
						
							|  |  |  |               minimize: true, | 
					
						
							|  |  |  |               removeComments: false, | 
					
						
							|  |  |  |               collapseWhitespace: false | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   plugins: [ | 
					
						
							| 
									
										
										
										
											2018-06-26 16:28:37 +08:00
										 |  |  |     new ForkTsCheckerWebpackPlugin({ | 
					
						
							|  |  |  |       checkSyntacticErrors: true, | 
					
						
							|  |  |  |     }), | 
					
						
							| 
									
										
										
										
											2017-10-02 02:02:25 +08:00
										 |  |  |   ] | 
					
						
							|  |  |  | }; |