just-jeb / angular-builders

Angular build facade extensions (Jest and custom webpack configuration)
MIT License
1.14k stars 198 forks source link

"Custom Webpack config function" doesn't work #267

Closed marcalj closed 5 years ago

marcalj commented 5 years ago

Describe the bug If using Custom Webpack config function to add an extra plugin it doesn't apply changes.

To Reproduce extra-webpack.config.js

const LoaderTemplatePlugin = require('./loaderTemplate.plugin');
const path = require('path');
const fs = require('fs');

module.exports = (config, options) => {
  config.plugins.push(
    new LoaderTemplatePlugin({
      templateFilePath: path.resolve(__dirname, '..', 'loader-templates/userscript.js'),
      filename: 'assets/userscript.js',
      replacements: {
        version: require('../package.json').version,
        serverPrefix: serverPrefix
      }
    })
  );

  return config;
};

Expected behavior Webpack runs "LoaderTemplatePlugin" plugin. It's an adhoc plugin which works without using custom webpack function config.

Builder: Libraries "@angular-builders/custom-webpack": "^7.3.1", "@angular-devkit/build-angular": "^0.11.4", "@angular/cli": "~7.1.3",

just-jeb commented 5 years ago

Custom webpack plugin function is available in 7.4.3