Code Monkey home page Code Monkey logo

Comments (17)

sleeper avatar sleeper commented on August 22, 2024

I guess this is feasible using the grunt templates and evaluating the package.json ...

I'm assigning myself to this to work on it later on.

from grunt-usemin.

sindresorhus avatar sindresorhus commented on August 22, 2024

Maybe just expose the grunt config and let the user add their package.json as they would do in the gruntfile?

from grunt-usemin.

khepin avatar khepin commented on August 22, 2024

It is possible in this very similar task (https://github.com/tactivos/grunt-htmlrefs).
However they don't have the replace of data-main for RequireJS.

Maybe these 2 projects should join forces rather than develop 2 versions of the "same thing" ?

from grunt-usemin.

sindresorhus avatar sindresorhus commented on August 22, 2024

Maybe these 2 projects should join forces rather than develop 2 versions of the "same thing" ?

@khepin see https://github.com/tactivos/grunt-htmlrefs/blob/master/tasks/grunt-htmlrefs.js#L5-L8

Might just get it right from the source. @johnnyhalife Why create your own instead of contributing?

from grunt-usemin.

johnnyhalife avatar johnnyhalife commented on August 22, 2024

I'm happy to contribute back, i.e we're doing pretty much the same however, usemin does minification and other stuff too. I wrote it on the banner of our task, we just wanted the replacement not the minification magic.

We should find a way to do this together and I'll discard our version while we keep contributing back to yeoman.

from grunt-usemin.

sindresorhus avatar sindresorhus commented on August 22, 2024

We should find a way to do this together and I'll discard our version while we keep contributing back to yeoman.

Definitely! Happy to hear :)

Can you be a bit more specific what grunt-usemin does that you don't need?

from grunt-usemin.

sleeper avatar sleeper commented on August 22, 2024

Actually grunt-usemin is not minifying by itself .. It is updating the min config, but not launching min by itself.

@johnnyhalife which part of grunt-usemin (or usemin) you're not using ?

from grunt-usemin.

johnnyhalife avatar johnnyhalife commented on August 22, 2024

So I created htmlrefs only because I needed to perform the replacements
we're not using minification at all (well, not through usemin we're using
google closure compilation, bundling, etc). Also I've added 2 new tasks
(include and remove) that we are using for updating our main index page (
https://github.com/tactivos/grunt-htmlrefs).

I'm thinking how about we keep to tasks but make one inherit the other
maybe? I'm fine moving htmlrefs to yeoman, and maybe we can override what
it does once it finds the blocks.

Just thinking out loud...

On Mon, Jan 14, 2013 at 8:52 PM, Frederick Ros [email protected]:

Actually grunt-usemin is not minifying by itself .. It is updating the minconfig, but not launching
min by itself.

@johnnyhalife https://github.com/johnnyhalife which part of grunt-usemin(or
usemin) you're not using ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-12246632.

from grunt-usemin.

sleeper avatar sleeper commented on August 22, 2024

Actually (and if I'm not wrong), the minification part of yeoman is done through min and not really from grunt-usemin (meaning it is part of a task, like 'useminPrepare rjs concat css min img rev usemin manifest').

So for this part, usemin should not be a problem ... I'll have a look at how we could merge/inherit easily ;)

from grunt-usemin.

sleeper avatar sleeper commented on August 22, 2024

cc/ @sindresorhus I guess this could be added to the Gruntfile template, by adding something like:

pkg: grunt.file.readJSON('package.json'),

at the beginning.

from grunt-usemin.

sindresorhus avatar sindresorhus commented on August 22, 2024

@sleeper Do you currently grunt.template.process() the paths from the usemin block? If so, then the above is the solution.

from grunt-usemin.

honi avatar honi commented on August 22, 2024

+1 to this, DRY!

from grunt-usemin.

asbjornenge avatar asbjornenge commented on August 22, 2024

Any news on this? Some times I end up using only useminPrepare. Easier to control my own versioning and leverage usemin in conjunction with other tools and packages. I made this fork of grunt-htmlref changing it's match pattern so I can use it together with usemin. Pull request have been issued.

from grunt-usemin.

sleeper avatar sleeper commented on August 22, 2024

Which PR are you referring to ?

from grunt-usemin.

johnnyhalife avatar johnnyhalife commented on August 22, 2024

@sleeper I guess the one on grunt-html that I've just merged :shipit:

from grunt-usemin.

johnnyhalife avatar johnnyhalife commented on August 22, 2024

@asbjornenge it's published under 0.4.2

from grunt-usemin.

asbjornenge avatar asbjornenge commented on August 22, 2024

Yeah, it was that one. Since htmlref was mentioned earlier. Sorry for not clarifying @sleeper. Excellent @johnnyhalife !!

from grunt-usemin.

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.