Skip to content

Commit

Permalink
BUGFIX: Prevent webpack from bundling react-ui-components twice
Browse files Browse the repository at this point in the history
Some modules referred to the components via

```js
import { /* ... */  } from '@neos-project/react-ui-components';
```

This caused webpack to pull the components from
'@neos-project/react-ui-components/lib-esm' rather than
'@neos-project/react-ui-components/src', leading to the
component modules being bundled twice.

The solution was to add an alias for
'@neos-project/react-ui-components' to the root webpack
config, so that the components are always pulled from 'src/'
at build-time.
  • Loading branch information
grebaldi committed Jun 21, 2023
1 parent bfd2024 commit 4cdec2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ module.exports = merge(
modules: [
path.resolve(__dirname, './packages/neos-ui/node_modules'),
path.resolve(__dirname, './node_modules')
]
],
alias: {
'@neos-project/react-ui-components$': path.resolve(__dirname, './packages/react-ui-components/src')
},
},
watchOptions: {
ignored: /node_modules/
Expand Down

0 comments on commit 4cdec2c

Please sign in to comment.