New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracting logic to standalone node module #23
Comments
Hi Pascal, This is the first time I've heard of gulp; it looks cool. Looking at the So...given that the whole html2js task is just a few dozen SLOC, it seems wdyt? On Fri, Dec 27, 2013 at 12:08 PM, Pascal Precht notifications@github.comwrote:
--Karl-- |
@karlgoldstein well if you think the current logic is that much coupled to grunt api's... yea than it might be a good thing to just start right away with a gulp port. However, we'd introduce a lot of DRY code, so I think it'd be better to abstract it away. Maybe we can first somehow summarise where the code is coupled to grunt API's so we get a lil overview of the current state. For a long term and for maintainability reasons it'd probably better to have one module that is wrapped by grunt/gulp tasks. Also, we'd open doors for other tools/scripts/process that could use html2js. :) |
I came to the Issues page to inquire about the same thing. My use case, however, is to potentially use atomify with Angular. I haven't looked at the source too closely yet but may give it a shot. |
Currently there are 3 Gulp plugins which do this: These all got written about the same time. As for me, I quickly looked through all the options this grunt plugin offers. To me it seems that most of those are not very useful / or not related to the core logic of the plugin. It seems to me that you never want to edit the generated code by hand, and therefore it doesn't matter that much how it looks etc. So using my plugin could look like this: gulp.src("./partials/*.html")
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(ngHtml2Js({
moduleName: "MyAwesomePartials",
prefix: "/partials"
}))
.pipe(concat("partials.min.js"))
.pipe(uglify())
.pipe(gulp.dest("./dist/partials")); From a general point of view it would indeed make sense to have a separate plugin which would just do the actual conversion of file contents. But considering how few lines of codes this actually is, I wonder whether that is worth it. |
Looking to close this issue. I have no experience with gulp. If you can present a PR, then I'd gladly look into it. |
Closing. |
Hey @karlgoldstein !
A few days ago I thought it could be a good thing to extract the main logic out of grunt-html2js and publish it as a standalone node module. The grunt task would rather be a wrapper to work with grunt.
Why? Because we now also have the gulp task runner and it could be a cool thing to have html2js in that env too :) wdyt?
The text was updated successfully, but these errors were encountered: