Git Product home page Git Product logo

Comments (7)

jonschlinkert avatar jonschlinkert commented on August 15, 2024

No prob. I'll have to take a look at this in a few days. In the meantime I'm happy to accept a pull request

from handlebars-helpers.

gourneau avatar gourneau commented on August 15, 2024

Would something as simple as this work. It would need the utils folder too. I don't know how to do this dynamically (non-hard coded file names) with grunt.

    uglify: {
      my_target: {
        files: {
          'lib/hh.min.js': ['lib/helper-lib.js', "lib/helpers/helpers-code.js", "lib/helpers/helpers-collections.js", "lib/helpers/helpers-comparisons.js", "lib/helpers/helpers-data.js", "lib/helpers/helpers-dates.js", "lib/helpers/helpers-html.js", "lib/helpers/helpers-inflections.js", "lib/helpers/helpers-logging.js", "lib/helpers/helpers-markdown.js", "lib/helpers/helpers-math.js", "lib/helpers/helpers-miscellaneous.js", "lib/helpers/helpers-numbers.js", "lib/helpers/helpers-path.js", "lib/helpers/helpers-strings.js", "lib/helpers/helpers-url.js", "lib/helpers/helpers.js"]


        }
      }
    },

from handlebars-helpers.

doowb avatar doowb commented on August 15, 2024

@gourneau I'm not sure if it's that simple. The project is using require right now to load in all those other files. I think it would need to be run through browserify or something like that to make it work outside of node. I haven't used those tools yet, so I'm not sure how the work. Also, some of our helpers rely on other node libraries.

@jonschlinkert and I have been talking about refactoring the helper source so we can make it easier to use in other template engines, and I think this will include having a browser specific version, using one of the tools out there or just making sure it works.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

Yeah, it would look like this:

uglify: {
  my_target: {
    files: {
      'lib/helpers.min.js': [
         'lib/helper-lib.js',
         'lib/helpers/helpers-*.js'
         'lib/helpers/helpers.js'
      ]
    }
  }
},

What env would you use them in? do the helpers need to be unwrapped?

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

lol looks like we were thinking the same thing at the same time

from handlebars-helpers.

doowb avatar doowb commented on August 15, 2024

😱

We can always try to use uglify and see what happens.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

technically this is a duplicate of this #36, let's continue this discussion there

from handlebars-helpers.

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.