Revises both universal and client build to use AOT and webpack for both. Guide text adjusted accordingly Dodges CLI client build, expected in near future. PR Close #18707
		
			
				
	
	
		
			35 lines
		
	
	
		
			706 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			706 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // #docregion
 | |
| const ngtools = require('@ngtools/webpack');
 | |
| const webpack = require('webpack');
 | |
| const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
 | |
| 
 | |
| module.exports = {
 | |
|   devtool: 'source-map',
 | |
|   entry: {
 | |
|     main: [ './src/main.ts' ]
 | |
|   },
 | |
|   resolve: {
 | |
|     extensions: ['.ts', '.js']
 | |
|   },
 | |
|   output: {
 | |
|     path: 'dist',
 | |
|     filename: 'client.js'
 | |
|   },
 | |
|   plugins: [
 | |
|     // compile with AOT
 | |
|     new ngtools.AotPlugin({
 | |
|       tsConfigPath: './tsconfig.client.json'
 | |
|     }),
 | |
| 
 | |
|     // minify
 | |
|     new UglifyJSPlugin()
 | |
|   ],
 | |
|   module: {
 | |
|     rules: [
 | |
|       { test: /\.css$/,  loader: 'raw-loader' },
 | |
|       { test: /\.html$/, loader: 'raw-loader' },
 | |
|       { test: /\.ts$/,   loader: '@ngtools/webpack' }
 | |
|     ]
 | |
|   }
 | |
| }
 |