Enonic version: 7.8.4 Enonic CLI version 2.3.0 OS: Windows 10 Pro
Hello,
I have a assets folder in ’src\main\resources\react4xp\assets\css\bootstrap.min.css’ direction. When I add import ‘./…/…/…/react4xp/assets/css/bootstrap.min.css’; to default.jsx, it has an error. If I add CDN link in default.es6 my problem will be solve but I need to import another files from assets. Could you help me please to fix the problem?
I haven’t either tested this with file/image loaders, I must admit. But the general idea is the same as in the scss-loader examples: if you add webpack rules to your custom webpack config (so the final webpack config is something that would work with vanilla webpack/npm etc), then react4xp should pick it up and detect the images as dependencies at build time, and serve them as assets the same way as other dependency assets at runtime. Although it may depend on how you want to use the images and loaders, I guess.
Thanks for replying, my main problem is identify in JS files in assets and images are not important for me now. I’ve used the same example but I didn’t get answer. Do I need to run npm after add the rules in webpack? If yes, what’s the npm command it?
Thanks a lot