Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 55b7136

Browse files
committed
Downgrade babel to prevent windows browsersync looping.
1 parent 8c6133c commit 55b7136

File tree

6 files changed

+1669
-3070
lines changed

6 files changed

+1669
-3070
lines changed

.babelrc

Lines changed: 5 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,13 @@
11
{
22
"env": {
33
"development": {
4-
"presets": [
5-
"@babel/preset-env"
6-
],
7-
"plugins": [
8-
"@babel/plugin-syntax-dynamic-import",
9-
"@babel/plugin-syntax-import-meta",
10-
"@babel/plugin-proposal-class-properties",
11-
"@babel/plugin-proposal-json-strings",
12-
[
13-
"@babel/plugin-proposal-decorators",
14-
{
15-
"legacy": true
16-
}
17-
],
18-
"@babel/plugin-proposal-function-sent",
19-
"@babel/plugin-proposal-export-namespace-from",
20-
"@babel/plugin-proposal-numeric-separator",
21-
"@babel/plugin-proposal-throw-expressions",
22-
"@babel/plugin-proposal-export-default-from",
23-
"@babel/plugin-proposal-logical-assignment-operators",
24-
"@babel/plugin-proposal-optional-chaining",
25-
[
26-
"@babel/plugin-proposal-pipeline-operator",
27-
{
28-
"proposal": "minimal"
29-
}
30-
],
31-
"@babel/plugin-proposal-nullish-coalescing-operator",
32-
"@babel/plugin-proposal-do-expressions"
33-
]
34-
},
4+
"presets": ["env", "stage-1"]
5+
},
356
"production": {
36-
"presets": [
37-
"@babel/preset-env"
38-
],
39-
"plugins": [
40-
"@babel/plugin-syntax-dynamic-import",
41-
"@babel/plugin-syntax-import-meta",
42-
"@babel/plugin-proposal-class-properties",
43-
"@babel/plugin-proposal-json-strings",
44-
[
45-
"@babel/plugin-proposal-decorators",
46-
{
47-
"legacy": true
48-
}
49-
],
50-
"@babel/plugin-proposal-function-sent",
51-
"@babel/plugin-proposal-export-namespace-from",
52-
"@babel/plugin-proposal-numeric-separator",
53-
"@babel/plugin-proposal-throw-expressions",
54-
"@babel/plugin-proposal-export-default-from",
55-
"@babel/plugin-proposal-logical-assignment-operators",
56-
"@babel/plugin-proposal-optional-chaining",
57-
[
58-
"@babel/plugin-proposal-pipeline-operator",
59-
{
60-
"proposal": "minimal"
61-
}
62-
],
63-
"@babel/plugin-proposal-nullish-coalescing-operator",
64-
"@babel/plugin-proposal-do-expressions"
65-
]
66-
},
7+
"presets": ["env", "stage-1"]
8+
},
679
"workers": {
68-
"presets": [
69-
[
70-
"@babel/preset-env",
71-
{
72-
"modules": false
73-
}
74-
]
75-
],
76-
"plugins": [
77-
"@babel/plugin-syntax-dynamic-import",
78-
"@babel/plugin-syntax-import-meta",
79-
"@babel/plugin-proposal-class-properties",
80-
"@babel/plugin-proposal-json-strings",
81-
[
82-
"@babel/plugin-proposal-decorators",
83-
{
84-
"legacy": true
85-
}
86-
],
87-
"@babel/plugin-proposal-function-sent",
88-
"@babel/plugin-proposal-export-namespace-from",
89-
"@babel/plugin-proposal-numeric-separator",
90-
"@babel/plugin-proposal-throw-expressions",
91-
"@babel/plugin-proposal-export-default-from",
92-
"@babel/plugin-proposal-logical-assignment-operators",
93-
"@babel/plugin-proposal-optional-chaining",
94-
[
95-
"@babel/plugin-proposal-pipeline-operator",
96-
{
97-
"proposal": "minimal"
98-
}
99-
],
100-
"@babel/plugin-proposal-nullish-coalescing-operator",
101-
"@babel/plugin-proposal-do-expressions"
102-
]
10+
"presets": [["env", { "modules": false }], "stage-1"]
10311
}
10412
}
10513
}

bin/processIndexForBuild.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ try {
1313
const content = String(indexHtml)
1414
.replace('<!-- BROWSER_SYNC_PLACEHOLDER (DO NOT REMOVE OR ALTER!) -->', '')
1515
.replace('// install babel hooks in the renderer process', '')
16-
.replace('require(\'@babel/register\');', '')
16+
.replace('require(\'babel-register\');', '')
1717
.replace('require(\'../js/start\')', 'require(\'../prod/start\')');
1818
fs.writeFileSync(indexOut, content);
1919
} catch (e) {

bootstrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// install babel hooks in the main process
22
if (process.env.NODE_ENV === 'development') {
3-
require('@babel/register'); // eslint-disable-line global-require
3+
require('babel-register'); // eslint-disable-line global-require
44
require('./main.js'); // eslint-disable-line global-require
55
} else {
66
require('./mainBuilt.js'); // eslint-disable-line global-require, import/no-unresolved

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525
<script>
2626
// install babel hooks in the renderer process
27-
require('@babel/register');
27+
require('babel-register');
2828
require('../js/start');
2929
</script>
3030
<script>

0 commit comments

Comments
 (0)