Skip to content

Commit 3b14462

Browse files
committed
Remove prettier dependency and improve build times
Replace prettier with pretty-fast in build generation. Remove unreliable babel configuration.
1 parent c427200 commit 3b14462

File tree

6 files changed

+63
-27
lines changed

6 files changed

+63
-27
lines changed

Gruntfile.js

-5
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ module.exports = grunt => {
9898
]
9999
},
100100
source: {
101-
// options: {
102-
// parserOptions: {
103-
// ecmaVersion: 8
104-
// }
105-
// },
106101
src: ['src/**/*.js']
107102
},
108103
test: {

package-lock.json

+49-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"omggif": "^1.0.10",
7878
"open": "^7.0.3",
7979
"opentype.js": "^0.9.0",
80-
"prettier": "^1.7.4",
80+
"pretty-fast": "^0.2.7",
8181
"promise-map-series": "^0.2.3",
8282
"puppeteer": "^10.2.0",
8383
"regenerator-runtime": "^0.13.3",
@@ -128,9 +128,6 @@
128128
}
129129
]
130130
],
131-
"generatorOpts": {
132-
"retainLines": true
133-
},
134131
"env": {
135132
"test": {
136133
"plugins": [

tasks/build/browserify.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import { resolve } from 'path';
66
import browserify from 'browserify';
7-
import { format } from 'prettier';
87
import derequire from 'derequire';
98

109
const bannerTemplate =
@@ -61,7 +60,9 @@ module.exports = function(grunt) {
6160
browserified = browserified.exclude('../../translations/dev');
6261
}
6362

64-
const babelifyOpts = { global: true };
63+
const babelifyOpts = {
64+
global: true
65+
};
6566

6667
if (isTest) {
6768
babelifyOpts.envName = 'test';
@@ -95,10 +96,11 @@ module.exports = function(grunt) {
9596

9697
// and prettify the code
9798
if (!isMin) {
98-
code = format(code, {
99-
singleQuote: true,
100-
printWidth: 80 + 12
101-
});
99+
const prettyFast = require('pretty-fast');
100+
code = prettyFast(code, {
101+
url: '(anonymous)',
102+
indent: ' '
103+
}).code;
102104
}
103105

104106
// finally, write it to disk

tasks/build/combineModules.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const fs = require('fs');
66
const path = require('path');
77
const browserify = require('browserify');
88
const derequire = require('derequire');
9-
const { format } = require('prettier');
109

1110
module.exports = function(grunt) {
1211
const tempFilePath = path.resolve('./src/customApp.js');
@@ -86,10 +85,11 @@ module.exports = function(grunt) {
8685

8786
// and prettify the code
8887
if (!isMin) {
89-
code = format(code, {
90-
singleQuote: true,
91-
printWidth: 80 + 12
92-
});
88+
const prettyFast = require('pretty-fast');
89+
code = prettyFast(code, {
90+
url: '(anonymous)',
91+
indent: ' '
92+
}).code;
9393
}
9494

9595
// finally, write it to disk and remove the temp file

tasks/build/eslint-samples.js

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ module.exports = grunt => {
4646
);
4747
}
4848

49-
// return report.errorCount === 0;
5049
done(report.errorCount === 0);
5150
}
5251
);

0 commit comments

Comments
 (0)