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 compressed dependencies #402

Open
elliothershberg opened this issue Feb 10, 2021 · 0 comments
Open

Allow compressed dependencies #402

elliothershberg opened this issue Feb 10, 2021 · 0 comments

Comments

@elliothershberg
Copy link

Hi! Thanks for the fantastic package. I've been building a htmlwidget, and am now trying to optimize bundle size. I am using reactR, and creating my widget dependency with webpack. I'm trying to use a webpack compression plugin.

My dependency is much smaller, but now is a .js.gz file, which doesn't get discovered by htmlwidgets. Would it be possible to update this function to look for a .js file or a .js.gz file?

htmlwidgets/R/utils.R

Lines 39 to 46 in 31dd945

#' Get js and css dependencies for a htmlwidget
#'
#' @param name name of the widget.
#' @param package name of the package, defaults to the widget name.
#' @export
getDependency <- function(name, package = name){
config = sprintf("htmlwidgets/%s.yaml", name)
jsfile = sprintf("htmlwidgets/%s.js", name)

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

1 participant