I’ve been doing some frontend on work on a Sage 9 project and we began encountering an issue that I believe I have found a resolution for… but I’m not sure why it wouldn’t be a known issue impacting others.
We’ve got some
font-face declarations in css files within our
assets/fonts directory. These CSS files are
@import'ed in Sage’s
Everything has been working fine until the first time these changes hit CI, then we started seeing
ModuleNotFoundError errors emitted from Webpack during the bundling process.
After messing around a bit locally, I found that the error was encountered only when running the
build:production script, not during
start or even the plain ole’
I spent some time looking in other areas only to find that the issue was caused by the lack of sourcemaps during production builds. I don’t have a problem with dropping sourcemaps in production however the loader which handles remapping the
url() attributes in the stylesheet requires sourcemaps.
Given that a built-in dependency requires sourcemaps to be enabled for production builds, I’m curious why this configuration exists and why others haven’t been encountering it.
I’m also aware that this could be a total issue of mistake on my part with my solution being only relevant to something I did in the past.
In either case, I’d love to hear if anyone else has experienced this or if there is any feedback on something else I should try.