diff --git a/package-lock.json b/package-lock.json index 2f5f16c..c9a8cb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2128,6 +2128,12 @@ "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", "dev": true }, + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + }, "diff-sequences": { "version": "24.3.0", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", @@ -5394,18 +5400,36 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lodash.hasin": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.hasin/-/lodash.hasin-4.5.2.tgz", + "integrity": "sha1-+R41I3jSHvcJC552h8LKNcW01So=", + "dev": true + }, "lodash.identity": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-2.3.0.tgz", "integrity": "sha1-awGiEMlIU1XCqRO0i2cRIZoXPe0=", "dev": true }, + "lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", + "dev": true + }, "lodash.isfunction": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-2.3.0.tgz", "integrity": "sha1-aylz5HpkfPEucNZ2rqE2Q3BuUmc=", "dev": true }, + "lodash.isnil": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", + "integrity": "sha1-SeKM1VkBNFjIFMVHnTxmOiG/qmw=", + "dev": true + }, "lodash.isobject": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.3.0.tgz", @@ -5438,6 +5462,12 @@ "integrity": "sha1-MFnWKNUbv5N80qC2/Dp/ISpmnCw=", "dev": true }, + "lodash.omitby": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", + "integrity": "sha1-XBX/R1StVVAWtTwEExHo8HkgR5E=", + "dev": true + }, "lodash.snakecase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", @@ -5552,6 +5582,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "magic-string": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz", + "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.1" + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -6665,6 +6704,21 @@ "rollup-pluginutils": "^2.3.0" } }, + "rollup-plugin-prettier": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-prettier/-/rollup-plugin-prettier-0.6.0.tgz", + "integrity": "sha512-BgfyZ1biKcAaRNzfUyG/CeI5dFn+WsygK7kYjuXM6aL4m3t/53ZpJI2ZSMAeaKj6w2dj3CkOYbT0gulwh2SvKA==", + "dev": true, + "requires": { + "diff": "4.0.1", + "lodash.hasin": "4.5.2", + "lodash.isempty": "4.4.0", + "lodash.isnil": "4.0.0", + "lodash.omitby": "4.6.0", + "magic-string": "0.25.1", + "prettier": "^1.0.0" + } + }, "rollup-plugin-sourcemaps": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.4.2.tgz", @@ -7042,6 +7096,12 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "sourcemap-codec": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", + "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", + "dev": true + }, "sourcemap-validator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/sourcemap-validator/-/sourcemap-validator-1.1.0.tgz", diff --git a/package.json b/package.json index 241e349..85d6f40 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "prettier": "^1.17.1", "rollup": "^1.11.3", "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-prettier": "^0.6.0", "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-uglify": "^6.0.2", "sourcemap-validator": "^1.1.0" diff --git a/rollup.config.js b/rollup.config.js index 20aff9d..8f64aa9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,7 @@ import { format } from "date-fns"; import { readFileSync } from "fs"; import { sync as globby } from "globby"; import babel from "rollup-plugin-babel"; +import prettier from "rollup-plugin-prettier"; import sourcemaps from "rollup-plugin-sourcemaps"; import { uglify } from "rollup-plugin-uglify"; @@ -49,7 +50,11 @@ const config = (extension, format, minified = false) => input => ({ name: format === "umd" ? "funCtional" : undefined }, plugins: - format === "umd" ? (minified ? [sourcemaps(), babel(), uglify()] : [sourcemaps(), babel()]) : [sourcemaps()] + format === "umd" + ? minified + ? [babel(), uglify(), sourcemaps()] + : [babel(), prettier(), sourcemaps()] + : [prettier(), sourcemaps()] }); const sourceFiles = getSourceFilesList();