Giter VIP home page Giter VIP logo

Comments (5)

bhauman avatar bhauman commented on May 17, 2024

I don't think I understand your situation completely.

But if you are working on a separate project in iframe, it is certainly possible.

You can change the :output-to and the :output-dir to anything path is in the resources directory.

Not sure if this helps.

from lein-figwheel.

bkolobara avatar bkolobara commented on May 17, 2024

I will try to clarify it.
My output-to looks like :output-to "build/extension/js/example.js". Right now it's required that my files go under resources/public. Or I get the Figwheel Config Error - your build :output-dir is not below the 'resources/public' directory. error.

I guess this is because when I run lein figwheel it starts a static file server and tries to serve my webpage. Is this part necessary? Because my page will be inside a browser extension that is manually added to the browser. I just need the part of figwheel that accepts the connection from the page and pushes recompiled changes back on save.

Is it possible to run it like this without the static serving part? Ideally I would like to have more build targets in my project.clj file and every one of them connecting to one independent figwheel server.

Maybe I just misunderstood how figwheel works, because I didn't have time to take a closer look at the code.

from lein-figwheel.

bhauman avatar bhauman commented on May 17, 2024

Yep, figwheel doesn't push the changed code, it only pushes the paths of the changed files and then the browser reloads them.

This is an interesting use case. I always assumed that the browser would have to load the files from a server. I also assumed that if I pushed and evalled the code that the connection would be much less stable. The browsers file loading mechanism is pretty bomb proof compared to trying to catch exceptions across an eval. Eval however makes you code indifferent to paths which is a nice thing.

Gonna think on this.

On May 16, 2014, at 3:07 AM, Bernard Kolobara [email protected] wrote:

I will try to clarify it.
My output-to looks like :output-to "build/extension/js/example.js". Right now it's required that my files go under resources/public. Or I get the Figwheel Config Error - your build :output-dir is not below the 'resources/public' directory. error.

I guess this is because when I run lein figwheel it starts a static file server and tries to serve my webpage. Is this part necessary? Because my page will be inside a browser extension that is manually added to the browser. I just need the part of figwheel that accepts the connection from the page and pushes recompiled changes back on save.

Is it possible to run it like this without the static serving part? Ideally I would like to have more build targets in my project.clj file and every one of them connecting to one independent figwheel server.

Maybe I just misunderstood how figwheel works, because I didn't have time to take a closer look at the code.


Reply to this email directly or view it on GitHub.

from lein-figwheel.

bhauman avatar bhauman commented on May 17, 2024

I just made a change that may make figwheel work for you.

I also modified the client so that it defaults to loading files from the host of the :websocket-url so this may make things work automatically if you are connected to the websocket server.

I also added a :url-rewriter option that takes a function which will be passed the full asset request url of javascript files and css files. You can modify the request url to point anywhere you want now.

Hope this helps.

from lein-figwheel.

bkolobara avatar bkolobara commented on May 17, 2024

Thank you. This is amazing!

from lein-figwheel.

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.