Skip to content

Commit

Permalink
Fixed webpack(5) config extender
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Dec 13, 2021
1 parent 85b5609 commit 36be271
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Improved `piral debug` to respect `--public-url` like `piral build`
- Fixed `publicPath` in pilets built with Webpack to be `./` instead of `/`
- Fixed default imports of shared dependencies with `v2` schema (#433)
- Fixed usage of `rules` in `extend-config` of `piral-cli-webpack(5)`
- Fixed usage of custom public path with `piral-ng` (#434)
- Removed `file-loader` from `piral-cli-webpack5`
- Added env variable `PIRAL_PUBLIC_PATH` during `piral build` and `piral debug` (#434)
Expand Down
3 changes: 2 additions & 1 deletion src/converters/piral-ng/extend-webpack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { AngularWebpackPlugin } = require('@ngtools/webpack');
const CopyPlugin = require('copy-webpack-plugin');

const { AngularWebpackPlugin } = require('@ngtools/webpack');
const { resolve } = require('path');

const ngtoolsLoader = require.resolve('@ngtools/webpack');
Expand Down
2 changes: 1 addition & 1 deletion src/tooling/piral-cli-webpack/extend-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = function (override) {
}

if ('rules' in override && Array.isArray(override.rules)) {
config.module.rules.push(...rules);
config.module.rules.push(...override.rules);
}

if ('removeRules' in override && Array.isArray(override.removeRules)) {
Expand Down
4 changes: 2 additions & 2 deletions src/tooling/piral-cli-webpack5/extend-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ module.exports = function (override) {
}

if ('rules' in override && Array.isArray(override.rules)) {
config.module.rules.push(...rules);
config.module.rules.push(...override.rules);
}

if ('removeRules' in override && Array.isArray(override.removeRules)) {
override.removeRules.forEach((rule) => changeRule(config, rule, () => undefined));
}

if ('plugins' in override && Array.isArray(override.plugins)) {
config.plugins.push(...plugins);
config.plugins.push(...override.plugins);
}

if ('removePlugins' in override && Array.isArray(override.removePlugins)) {
Expand Down

0 comments on commit 36be271

Please sign in to comment.