Skip to content

Commit

Permalink
Merge pull request #29 from Constantiner/feature/issue-16-format-umd-…
Browse files Browse the repository at this point in the history
…files-in-distributive-with-prettier

Format UMD files in distributive with prettier

Fix #16
  • Loading branch information
Constantiner authored May 20, 2019
2 parents 4f2bc82 + ccdf835 commit 61af1d1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 61af1d1

Please sign in to comment.