Angular-RU / angular-cli-webpack

Webpack configuration modifier for @angular/cli
MIT License
67 stars 5 forks source link

Improved generated config #11

Closed splincode closed 6 years ago

splincode commented 6 years ago

Before:

import * as webpack from 'webpack';
import {WebpackConfigOptions} from '@angular/cli/models/webpack-config';
import {BuildOptions} from '@angular/cli/models/build-options';

export default function(config: webpack.Configuration, options: WebpackConfigOptions<BuildOptions>, command = process.argv[2]) {
    console.log(config);
    return config;
}

After

import * as webpack from 'webpack';
import { WebpackConfigOptions as ConfigOptions } from '@angular/cli/models/webpack-config';
import { BuildOptions } from '@angular/cli/models/build-options';

type Configuration= webpack.Configuration;
const DEFAULT_ARGS = process.argv[2];

export default function(config: webpack.Configuration, options: ConfigOptions<BuildOptions>, argv) {
    const commands = argv || DEFAULT_ARGS;

    console.log('For modify webpack build, you can usage ngw.config.ts');
    return config;
}