npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theme-tools/plugin-js-concat-babel

v1.1.0

Published

JS Concat and Babel plugin for Theme Core

Readme

JS (Concat, Babel) Plugin for Theme Tools

Theme core plugins let you easily pass in configuration and get a set of Gulp-ready task functions back that have sensible defaults and work well together.

Features

  • Concatenate multiple JS files into a single file
  • Run through Babel so you can use ES6 thanks to babel-preset-es2015 (optional)
  • Process end file with Uglify (optional)
  • Validate code using ESlint (optional)
  • Watch tasks that only lints changed files

Getting Started

Requirements

  • Gulp 4 installed with npm install --save gulp@4

Install

npm install @theme-tools/plugin-js-concat-babel --save

Configure

The config that is passed in is merged with config.default.js. We suggest starting with config.simple.js to get started:

cp node_modules/@theme-tools/plugin-js-concat-babel/config.simple.js config.js.js

Setup

Add this to your gulpfile.js:

const gulp = require('gulp');
const config = {};
config.js = require('./config.js.js');
const jsTasks = require('@theme-tools/plugin-js-concat-babel')(config.js);

gulp.task('validate:js', jsTasks.validate);
gulp.task('js', jsTasks.compile);
gulp.task('fix:js', jsTasks.fix);
gulp.task('clean:js', jsTasks.clean);
gulp.task('watch:js', jsTasks.watch);

Details

Tasks

These tasks are methods inside jsTasks from the above code example. You can run them anyway you can run a function, though they are often ran via Gulp. All tasks take a callback function as the first and only parameter that will run when the task is done - exactly how gulp.task(), gulp.parallel(), and gulp.series() want.

jsTasks.compile() - Compile JS

Concat all the files in config.src together, run them through Babel with the babel-preset-es2015 preset, Uglify it, then write it to config.dest.

jsTasks.validate() - Lint using Eslint

Test code using eslint.

jsTasks.fix() - Try Fix Eslint Errors/Warnings

Fix the easy stuff to fix. Modifies original files. Awesome.

jsTasks.clean() - Clean files

Deletes files that were made.

jsTasks.watch() - Watch files

Watches files, then compiles and validates the changed files.

Configuration

All configuration is deep merged with config.default.js.

src

Type: Array<String> Default: [ 'js/**/*.js' ]

All the files to work on.

dest

Type: String Default: 'dest/'

Destination folder to write files.

destName

Type: String Default: 'all.js'

The filename to write.

sourceMapEmbed

Type: Boolean Default: false

Should sourcemaps be embeded in the file or as their own *.js.map file?

uglify

Type: Boolean Default: true

Should the file be Uglified?

babel

Type: Boolean Default: true

Should Babel transpile the JS using the babelConfig?

babelConfig

Type: Object Default: {}

Configuration for Babel, basically the contents of .babelrc. This is where you'd add presets or plugins and would want to do it like this to avoid weird bugs:

babelConfig: {
  presets: ['babel-preset-es2015'].map(require.resolve),
},

eslint

Type: Object

eslint.enabled

Type: Boolean Default: true

Enable ESlint?

eslint.extraSrc

Type: Array<String> Default: []

A list that can use globbing of files to lint on top of what is found in src.

Setup Details

Setting up basic Babel

  1. Run npm install --save babel-preset-es2015
  2. Add this to your config:
babelConfig: {
  presets: ['babel-preset-es2015'].map(require.resolve),
},

Setting up ESlint

  1. Create your configuration file (i.e. .eslintrc)

Theme Core Events

This is only info for other Theme Core plugin developers.

emit 'reload'

This event is emmited when files are done compiling. The first paramater is a String of the files changed.