Coder Social home page Coder Social logo

Comments (10)

jonschlinkert avatar jonschlinkert commented on May 26, 2024

I think one of these should do what you need:

from assemble-less.

MarcDiethelm avatar MarcDiethelm commented on May 26, 2024

Hmm, I'm afraid not. I was looking at all of these.

'Process' comes close, because it allows to use a variable that is defined in Gruntfile.js. However, I'd rather not process all the source files just to interpolate one instance of a Grunt template. Asset building is somewhat slow as it is already.

'Metadata' and 'pass in' depend on files in a specific format. This is pretty much incompatible with my setup, where the whole configuration of the framework is a product of deep merging JS(ON) from multiple files, most of which are edited by users. This config creation is done when starting the server/framework and each time a Grunt task is executed. The variable I need to inject into Less is defined during this process.

It would just be very handy to have a straightforward mechanism to inject some simple variables into the parser. The values of which are only known once Grunt is running its tasks.

from assemble-less.

jonschlinkert avatar jonschlinkert commented on May 26, 2024

I'm struggling to see exactly what you want to do, do you have a live example somewhere? it would help for me to see it live, and failing.

Also, if you care to share some of what you're working on, I might be able to help you improve even further. I'm working on other solutions that you might be able to leverage as well.

from assemble-less.

jonschlinkert avatar jonschlinkert commented on May 26, 2024

actually, let me look at 0.4.8 and see what I was doing differently too

from assemble-less.

MarcDiethelm avatar MarcDiethelm commented on May 26, 2024

It's a bit difficult to describe what's going on in a GH issue. I hope this gives you enough pointers.

A live example... not currently. But it would not be very helpful to observe the framework only from the client perspective.

Of course you can look at the full source of the project, no problem. Feel free to clone and run the project from the develop branch. ;) The project is here: https://github.com/MarcDiethelm/xtc

npm start and npm test are set up.

For one there's the now failing test when using a banner to inject a variable:
https://travis-ci.org/MarcDiethelm/xtc/jobs/11159778

This is the Grunt target 'less:external':
https://github.com/MarcDiethelm/xtc/blob/develop/Gruntfile.js#L184
(At the top of this file you see an example of how the configuration is built. This mechanism is used in many tests and the app itself.)

Here's a the test fixture (.less) that uses the variable:
https://github.com/MarcDiethelm/xtc/blob/develop/test/assets/fixtures/_base/css/elements/base1.less
(Testing with this fixture fails earlier than the above test output indicates, because the variable is not defined. I added this part to the test after the initial failures. Nonetheless I need it to pass.)

If you have questions just ask. In the meantime thanks a ton for looking into this.

from assemble-less.

MarcDiethelm avatar MarcDiethelm commented on May 26, 2024

I went ahead and made the changes to restore banner behavior. Includes tests.

Please ignore b8a39ed, it references a commit on a deleted branch, made before I added the tests. Github should not even show it.

from assemble-less.

MarcDiethelm avatar MarcDiethelm commented on May 26, 2024

Can you publish the changes on npm? ...New installs of my framework will work again and Travis will report passing builds.

from assemble-less.

jonschlinkert avatar jonschlinkert commented on May 26, 2024

no prob, thanks for the reminder!

from assemble-less.

jonschlinkert avatar jonschlinkert commented on May 26, 2024

done. however the tests are failing. looks whitespace related

from assemble-less.

jonschlinkert avatar jonschlinkert commented on May 26, 2024

nvm, I fixed it

from assemble-less.

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.