urbit-ob

JavaScript utilities for phonemic base wrangling.
Log | Files | Refs | README

commit d56a68cdd76a7b4a01697c6740987816893fbdd2
parent 4bb94e14b1be750e9e001d434881e89b63b0e7b1
Author: Jared Tobin <jared@jtobin.io>
Date:   Wed,  7 Aug 2019 06:35:10 -0230

Clean up build.

Removes gulp, which doesn't really do anything for us here, and just
uses plain old rollup for the build.

Additionally, removes some unnecessary rollup plugins that were being
pulled in.

Diffstat:
MCHANGELOG | 2+-
Dgulpfile.js | 37-------------------------------------
Mpackage.json | 10++--------
Arollup.config.js | 19+++++++++++++++++++
4 files changed, 22 insertions(+), 46 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,7 +1,7 @@ # Changelog - 4.0.2 (2019-08-01) - * Removes most of lodash, adds gulp build automation for the browser. + * Removes most of lodash and adds a browser build. - 4.0.1 (2019-06-17) * Fixes a bug in isValidPat{p, q} that caused it to return 'true' for '~'. diff --git a/gulpfile.js b/gulpfile.js @@ -1,37 +0,0 @@ -var gulp = require('gulp'); -var rollup = require('gulp-better-rollup'); -var sucrase = require('@sucrase/gulp-plugin'); -var resolve = require('rollup-plugin-node-resolve'); -var commonjs = require('rollup-plugin-commonjs'); -var replace = require('rollup-plugin-replace'); -var builtins = require('rollup-plugin-node-builtins'); -var globals = require('rollup-plugin-node-globals'); -var rootImport = require('rollup-plugin-root-import'); - -gulp.task('default', function(cb) { - return gulp - .src('src/index.js') - .pipe(rollup({ - plugins: [ - // the order of these plugins matter - commonjs(), - replace({ - 'process.env.NODE_ENV': JSON.stringify('development') - }), - rootImport({ - root: `${__dirname}/dist`, - useEntry: 'prepend', - extensions: '.js' - }), - globals(), - builtins(), - resolve() - ] - }, 'cjs')) - .on('error', function(e){ - console.log(e); - cb(); - }) - .pipe(gulp.dest('./dist/')) - .on('end', cb); -}); diff --git a/package.json b/package.json @@ -6,7 +6,7 @@ "main": "src/index.js", "browser": "dist/index.js", "scripts": { - "build": "gulp", + "build": "rollup -c rollup.config.js", "test": "nyc mocha --reporter spec" }, "repository": { @@ -19,10 +19,7 @@ "author": "Tlon", "license": "MIT", "devDependencies": { - "@sucrase/gulp-plugin": "^2.0.0", "chai": "^4.2.0", - "gulp": "^4.0.2", - "gulp-better-rollup": "^4.0.1", "jsverify": "^0.8.3", "mocha": "^5.2.0", "nyc": "^13.1.0", @@ -30,10 +27,7 @@ "rollup-plugin-commonjs": "^10.0.1", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-replace": "^2.2.0", - "rollup-plugin-root-import": "^0.2.4", - "sucrase": "^3.10.1" + "rollup-plugin-node-resolve": "^5.2.0" }, "dependencies": { "bn.js": "^4.11.8", diff --git a/rollup.config.js b/rollup.config.js @@ -0,0 +1,19 @@ +import resolve from 'rollup-plugin-node-resolve' +import commonjs from 'rollup-plugin-commonjs' +import builtins from 'rollup-plugin-node-builtins' +import globals from 'rollup-plugin-node-globals' + +export default { + input: 'src/index.js', + output: { + file: 'dist/index.js', + format: 'cjs', + exports: 'named' + }, + plugins: [ + commonjs(), + globals(), + builtins(), + resolve() + ] +}