git ssb

10+

Matt McKegg / patchwork



load css in compatible way with liteclient

%V89j+LdmjoQZy1IuSK2LPc4pdY7vUEDRR0nHEo7NgRY=.sha256
OpenDominic opened this issue on 11/11/2016, 11:42:44 PM

load css in compatible way with liteclient

unfortunately loading css the way you are does not work in browserify. It's gotta be able to statically detect the file names to work with brfs. In patchbay, we have a build step, but it's kinda annoying.

%5pWLNdr+Nx4LrvhT3suENIWPoJF31M6f8xK8ie79Gzk=.sha256 Matt McKegg · 11/12/2016, 12:38:50 AM

I think I used evalify to solve this in web-audio-school: https://github.com/ahdinosaur/evalify

So all we'd have to do is add

{
  "transform": [
    ["evalify", { files: [ "`styles/index.js" ] } ]
  ]
}

And the contents of styles/index.js would be computed on bundle rather than on require. Perfect for this kind of thing. Basically a build step, but at least it is combined with the browserify step.

%4z2HKlpeC6r5rneQjUvd81yV6/lFnI0GZ0W9PBb/J90=.sha256 Dominic · 11/12/2016, 11:12:47 AM

oh, so this works (only) for modules that return a data structure? not quite sure how I feel about that. but it is clever

%M2i8XcGMen+y4aOHN3qRfm/xnJwfgqgyUWwnG1dtNYY=.sha256 Matt McKegg · 11/12/2016, 11:39:30 AM

Yeah, anything that can be serialized to json.

Built with git-ssb-web