Skip to content

Commit 82961d4

Browse files
authored
Merge pull request #2213 from floccusaddon/perf/improve-build-time
perf(build): Improve build time
2 parents ec74a52 + c242a8a commit 82961d4

6 files changed

Lines changed: 43 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444
run: |
4545
npm ci -f
4646
47+
- name: Lint code
48+
run: |
49+
npm run lint
50+
51+
- name: TypeScript check
52+
run: |
53+
npm run typecheck
54+
4755
- name: Install dependencies & build
4856
run: |
4957
npm run build-release --if-present

gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ const js = async function() {
104104
resolve()
105105
})
106106
)
107-
await new Promise(resolve => setTimeout(resolve, 5000))
108107
statsJson.children.forEach(statsJson => html(statsJson))
109108
statsJson.children.forEach(statsJson => webpackCheck(statsJson))
110109
}

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
"version": "5.8.6",
44
"description": "Sync your bookmarks privately across browsers and devices",
55
"scripts": {
6-
"build": "NODE_OPTIONS=--max-old-space-size=12000 gulp",
7-
"build-win": "SET NODE_OPTIONS=--max-old-space-size=12000 & gulp",
8-
"build-release": "NODE_OPTIONS=--max-old-space-size=12000 gulp release",
9-
"build-release-win": "SET NODE_OPTIONS=--max-old-space-size=12000 & gulp release",
10-
"watch": "NODE_OPTIONS=--max-old-space-size=12000 gulp watch",
11-
"watch-win": "SET NODE_OPTIONS=--max-old-space-size=12000 & gulp watch",
6+
"build": "NODE_OPTIONS=--max-old-space-size=4096 gulp",
7+
"build-win": "SET NODE_OPTIONS=--max-old-space-size=4096 & gulp",
8+
"build-release": "NODE_OPTIONS=--max-old-space-size=4096 gulp release",
9+
"build-release-win": "SET NODE_OPTIONS=--max-old-space-size=4096 & gulp release",
10+
"watch": "NODE_OPTIONS=--max-old-space-size=4096 gulp watch",
11+
"watch-win": "SET NODE_OPTIONS=--max-old-space-size=4096 & gulp watch",
1212
"test": "node --unhandled-rejections=strict test/selenium-runner.js",
1313
"lint": "eslint --ext .js,.vue src",
1414
"lint:fix": "eslint --ext .js,.vue src --fix",
15+
"typecheck": "tsc --noEmit",
1516
"doiuse": "doiuse dist/js/css/*.css",
1617
"supportedBrowsers": "echo \"module.exports = $(browserslist-useragent-regexp --allowHigherVersions);\" > supportedBrowsers.js"
1718
},

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"noImplicitThis": true,
1010
"esModuleInterop": true,
1111
"resolveJsonModule": true,
12+
"skipLibCheck": true,
1213
"lib": [
1314
"DOM",
1415
"es2019",

webpack.common.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ const common = {
1212
},
1313
module: {
1414
rules: [
15-
{
16-
test: /\.(js|vue)$/,
17-
use: 'eslint-loader',
18-
exclude: /node_modules/,
19-
enforce: 'pre',
20-
},
2115
{
2216
test: /\.css$/,
2317
use: ['vue-style-loader', 'css-loader'],
@@ -47,7 +41,12 @@ const common = {
4741
},
4842
{
4943
test: /\.tsx?$/,
50-
use: 'ts-loader',
44+
use: {
45+
loader: 'ts-loader',
46+
options: {
47+
transpileOnly: true,
48+
}
49+
},
5150
exclude: /node_modules/,
5251
},
5352
{
@@ -56,6 +55,7 @@ const common = {
5655
use: {
5756
loader: 'babel-loader',
5857
options: {
58+
cacheDirectory: true,
5959
presets: [
6060
[
6161
'@babel/preset-env',
@@ -134,7 +134,12 @@ module.exports = [
134134
},
135135
{
136136
test: /\.tsx?$/,
137-
use: 'ts-loader',
137+
use: {
138+
loader: 'ts-loader',
139+
options: {
140+
transpileOnly: true,
141+
}
142+
},
138143
exclude: /node_modules/,
139144
},
140145
{
@@ -143,6 +148,7 @@ module.exports = [
143148
use: {
144149
loader: 'babel-loader',
145150
options: {
151+
cacheDirectory: true,
146152
presets: [
147153
[
148154
'@babel/preset-env',

webpack.prod.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ module.exports = common.map(common => merge(common, {
1616
new webpack.DefinePlugin({
1717
DEBUG: JSON.stringify(false)
1818
}),
19-
sentryWebpackPlugin({
20-
authToken: process.env.SENTRY_AUTH_TOKEN,
21-
org: "marcel-klehr",
22-
project: "floccus",
23-
release: {
24-
name: packageJSON.version
25-
},
26-
sourcemaps: {
27-
disable: true,
28-
}
29-
}),
19+
...(process.env.SENTRY_AUTH_TOKEN ? [
20+
sentryWebpackPlugin({
21+
authToken: process.env.SENTRY_AUTH_TOKEN,
22+
org: "marcel-klehr",
23+
project: "floccus",
24+
release: {
25+
name: packageJSON.version
26+
},
27+
sourcemaps: {
28+
disable: true,
29+
}
30+
})
31+
] : []),
3032
]
3133
}))

0 commit comments

Comments
 (0)