New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[request] Allow for custom modes #2214
Comments
Continuation of: https://discourse.roots.io/t/setting-up-browser-sync-for-local-but-not-for-a-dev-staging-site/25121 The bud compiler modes map to Webpack 5 modes, this is logical. It is not intended that Webpack compiler modes should be created / extended - they underpin how the module bundler works at its base level. I do not think custom Bud modes should be implemented. @kupoback - Sorry to chip in here again, but it seems like you haven't found a solution yet. What you're looking to achieve is already supported - see the suggestion in the Discourse thread using environment variables and Your Unless I'm completely mistaken. In which case, I'll dig a hole to climb into. @kellymears, please could you validate this advice? |
@talss89 this is correct. there is no plan to release any type of custom mode for something to this effect: # .env
BUD_LOCAL=true bud.when(
/* condition */
bud.env.is(`BUD_LOCAL`, true),
/* when true */
bud => bud.devtool(`inline-cheap-module-source-map`),
/* when false (optional) */
bud => bud.minimize()
) |
I guess I updated my discourse thread but not here. I was looking for 2 things for local, 1 of them for dev, and none for prod. Local: Watcher + Sourcemaps I will take a look at the |
Great, remember you can set env vars in a |
@kupoback bud.js will read envvars from anywhere in the theme path automatically, starting at root. Conflicting env will be overridden with the lower directory taking precedence. So if you define from querying
|
Thank you, this actually helped out tremendously. I didn't think about fetching fro the |
Agreement
The feature
Looking for the ability to either add a custom compiler mode outside of just
development
orproduction
, or the inclusion of alocal
mode.Use case
When our frontend developers work locally, we want to be able to serve the files locally, with source-maps, and unminified.
When we deploy to a
dev
orstaging
server, we still require the ability to have the CSS files with source-maps, unminified, but we are not serving the site with Node.Notes
I've already tried playing around with different
bud.config.json
files of.local
and what not, but I was unable to get it to work correctly. I am stuck with eitherbud dev
orbud build production
and cannot manipulate or adjust thebud dev
in any way to serve a proxy URL locally via thepackage.json
scripts, not am I able to really make a config file that's specific to a local environment.The text was updated successfully, but these errors were encountered: