For Autocompeter I develop with gulp. It's like Grunt but better.

One thing I wanted was that when it makes the src/autocompeter.js --> minify() --> dist/autocompeter.min.js step I also wanted to put in a little preample header into the minified file.

First I thought, since UglifyJS supports a --preamble option that that'd be the route to go. I didn't get very far.

Then I thought I had to write my own plugin. So I started reading the documentation about how to write a plugin and partially thinking "Oh I don't have time to do this" and also "Oh finally a chance to sit down and really understand how gulp plugins work". I was wrong. The documentation for writing plugins say:

"Your plugin shouldn't do things that other plugins are responsible for... ...It should not add headers, gulp-header does that"

Oh! So there is already a great plugin for this! Long story short; here's how I used it. The output is that the version number is now on the first line of autocompeter.min.js.

I'm starting to like gulp more and more. There's even a dedicate nice index of all available plugins.

Comments

Anonymous

odd

Your email will never ever be published.

Previous:
Autocompeter 1.1.8 and smooth typing April 6, 2015 Go, JavaScript
Next:
Match the whole word in auto complete maybe April 10, 2015 Web development, JavaScript
Related by category:
Switching from Next.js to Vite + wouter July 28, 2023 JavaScript
How to SSG a Vite SPA April 26, 2025 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
swr compared to @tanstack/react-query August 30, 2024 JavaScript
Related by keyword:
A quicksearch for Bugzilla using Autocompeter January 27, 2016 Python, Web development, Mozilla, JavaScript
Grymt - because I didn't invent Grunt here April 18, 2014 Python, Web development, JavaScript
Autocompeter is Dead. Long live Autocompeter! January 9, 2017 Python, Web development, Go
Autocompeter.com April 2, 2015 Go, JavaScript