Skip to content
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

Allow local fonts to be omitted from webpack #59

Open
casperwarnich opened this issue May 21, 2021 · 2 comments
Open

Allow local fonts to be omitted from webpack #59

casperwarnich opened this issue May 21, 2021 · 2 comments

Comments

@casperwarnich
Copy link

casperwarnich commented May 21, 2021

I'd like to be able to change fonts without recompiling the templates.

Is it possible to add something like this in config/webpack.config.prod.js in caspar-graphics via a parameter in the build script?:

  {
    test: /\.(woff|woff2|eot|ttf|svg)$/,
    exclude: /node_modules/,
    loader: 'url-loader?limit=1024&name=fonts/[name].[ext]'
  }
@tobiasandersen
Copy link
Contributor

I've been thinking about exposing the entire webpack config and allow users to overwrite it (similar to what Razzle is doing: https://razzlejs.org/docs/customization#extending-webpack), but I'm worried we'll regret that in the future. How would you see this being configured?

@casperwarnich
Copy link
Author

casperwarnich commented May 31, 2021

I'm not very skilled with custom npm packages and what the limitations are, but I was thinking one of two things:
1: caspar-graphics could check If a "webpack.config.prod.js" or "webpack.config.dev.js" file was present in either the src or root of the enduser project, and then use those instead of it's own /config folder.
2: The same as 1 but also add a tag to the build script. I.e. caspar-graphics build --customwebpack ./src/webpack.config.prod.js or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants