Just setup the latest sage 9 (beta 2 ). Whenever i run “yarn run start”, it seems that the styles are not being compiled. I see no errors, but in the “dist” folder I only see the “vendor” and “scripts” folder, but not the “styles” folder.
However, when running “yarn run build” the styles folder generates fine.
I’ll spend some time looking into the build scripts, but if anyone have any insights into this that’ll be awesome, thanks.
Hi there. Is there any way to force dist/styles directory to be created while watching? For some reason I need production files to be written and I’d like to avoid running yarn build:production each time I make a change. I tried some tweaks in webpack configuration files but I’m new to it and couldn’t figure it out… Thanks.
Thanks @QWp6t , I already stumbled upon this, but it’s only for webpack-dev-server: “This plugin has no effect when webpack program is used instead of webpack-dev-server.”. Unfortunately Sage uses BrowserSync as its server, so it’s not applicable here as I understand it.
Edit: Ok, so my hack above stopped working a few days ago for no apparent reason. After a lot of struggles, I finally tried the WriteFileWebpackPlugin. Works like a charm! (with a few hacks, see in Github below). Turns out I misunderstood how Sage watch mode works. It’s using browsersync-webpack-plugin (different from browser-sync-webpack-plugin!), which internally actually uses webpack-dev-server, so my idea above was false. Phew, that’s a pretty hard first time with Webpack for me Thanks again.
Sorry to re-open this thread but I am having the same issue, I notice when you yarn build or yarn build:production creates the /dist directory, however when running yarn start run it is not creating the /dist directory at all.
No errors on yarn build or yarn build:production.
I have had yarn run start create the /dist folder a few times but not often it works first time. I just keep trying and have eventually just seen it work after numerous attempts. The devUrl I can access as normal, but of course there is still no /dist folder to render styling from.
@JordanC26 It’s the way it’s meant to work. CSS is more or less in RAM and injected in the page by Webpack (only in dev). So you’ll have to hack it to force Webpack to generate a file at this moment. Did you try the solution proposed in my latest comment?