Skip to content

Commit

Permalink
feat: generate esm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
teclone committed Jan 19, 2020
1 parent a694d0f commit dc2a517
Show file tree
Hide file tree
Showing 6 changed files with 1,515 additions and 1,224 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules
/lib
/dist
/coverage
/coverage
/build
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"name": "@forensic-js/utils",
"version": "0.0.0-development",
"description": "A collection of day-to-day utility methods usable in both node and browser environments",
"main": "lib/index",
"typings": "lib/typings/index",
"main": "build/index",
"module": "build/esm/index",
"typings": "build/index",
"publishConfig": {
"access": "public"
},
"scripts": {
"commit": "git-cz",
"test": "BABEL_ENV=test jest",
"watch-test": "BABEL_ENV=test jest --watch",
"build": "rimraf dist lib && tsc && BABEL_ENV=build rollup --config",
"build": "rimraf build && tsc && rollup-all",
"report-coverage": "jest --coverage --coverageReporters=text-lcov | coveralls",
"semantic-release": "semantic-release"
},
Expand All @@ -38,11 +39,7 @@
"cz-conventional-changelog": "2.1.0",
"jest": "24.3.1",
"rimraf": "2.6.3",
"rollup": "0.66.6",
"rollup-all": "1.6.16",
"rollup-plugin-babel": "4.3.2",
"rollup-plugin-node-resolve": "3.4.0",
"rollup-plugin-uglify": "6.0.2",
"rollup-all": "1.10.0",
"semantic-release": "^15.13.24",
"semantic-release-cli": "5.2.1",
"tslint": "5.12.0",
Expand Down
28 changes: 3 additions & 25 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';

import rollupAll from 'rollup-all';

const plugins = [
resolve({
extensions: ['.ts', '.js'],
}),
babel({
exclude: 'node_modules/**',
extensions: ['.ts', '.js'],
}),
];

export default rollupAll.getExports(uglify(), plugins, {
entryFile: 'index.ts',
moduleName: 'Utils',
distConfig: {
enabled: true,
},
libConfig: {
enabled: true,
},
const { config } = require('rollup-all');
module.exports = config({
config: {}
});
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const isObject = <T = object>(arg: any): arg is T => {
return (
typeof arg === 'object' &&
arg !== null &&
arg !== undefined &&
!isCallable(arg) &&
!isArray(arg) &&
!isRegex(arg)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"target": "esnext",
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "./lib/typings",
"declarationDir": "./build",
"noImplicitAny": false,
"downlevelIteration": true,
"lib": ["dom", "es5", "es2015.collection", "es2015.iterable"]
Expand Down

0 comments on commit dc2a517

Please sign in to comment.