GithubHelp home page GithubHelp logo

Comments (1)

timhaines avatar timhaines commented on June 13, 2024

Hi @bewatts, we talked a little about this off-github - and I think you got things working correctly by switching to our NativeLoader and by adjusting gulp to compile the CSS to disk.

We've since released an update to the percy-capybara gem, that adds a FilesystemLoader. If you do have your css and images etc being compiled into a folder as part of your build process, then I'd recommend switching to the FilesystemLoader (it's faster, and solves a few other problems related to asset identification).

You configure it like this, where you're currently initializing your build:

assets_dir = File.expand_path("../../dist_assets", __FILE__)
Percy::Capybara.use_loader(:filesystem, assets_dir: assets_dir, base_url: '/assets')
Percy::Capybara.initialize_build

You will also need to specify an assets_dir. assets_dir is the absolute path where Percy can find your assets, and should contain your compiled static assets rather than your source assets.

You can also optionally provide a base_url if your web-server serves assets with a path prefix.

If you try this, let me know how you get on?

Also, I'd love to understand a little more about your setup so we can better cater to this in the future. How are you embedding react in rails / serving html? Are you using react-rails or something similar?

Thanks Ben!

from percy-capybara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.