mendix / pluggable-widgets-tools

Moved to widget resources:
https://github.com/mendix/widgets-resources/
Apache License 2.0
8 stars 5 forks source link

Image Require does not Work #53

Closed cliedeman closed 4 years ago

cliedeman commented 4 years ago

Adding a require('../../image') does not currently work.

Get an error saying no loader found for type png.

Managed to hack around it with this

          {
              test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
              loader: require.resolve('url-loader'),
            },

But I am not sure what the correct solution is

cliedeman commented 4 years ago

I noticed that the ChartJS example actually adds this to the webpack.config.js

https://github.com/mendixlabs/ChartJS/blob/ec14007a3a74ac9a0cd3188208f80958dfeb2960/webpack.config.js#L142

diego-antonelli commented 4 years ago

Hi @cliedeman. Its not an issue! You can extends the webpack configuration following the documentation of the current library.

https://github.com/mendix/pluggable-widgets-tools#webpack-extensibility

I'll close the issue for now, if you really think we need to implement this, please open a PR

cliedeman commented 4 years ago

Hi @diego-antonelli thanks that will work but its quite confusing to users who are not well versed in react-native or webpack.

Can we extend the default generator to include a url loader?