Skip to content

Commit 9951c81

Browse files
committed
Use babel to transform JS
After this, we can generally use most modern JS without having to look at caniuse.com and see if the feature is supported. Ref #1373
1 parent f9c2f61 commit 9951c81

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

babel.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "0.1.0",
44
"description": "`BinderHub`",
55
"devDependencies": {
6+
"@babel/cli": "^7.15.7",
7+
"@babel/core": "^7.15.5",
8+
"@babel/preset-env": "^7.15.6",
9+
"babel-loader": "^8.2.2",
610
"css-loader": "^6.2.0",
711
"eslint": "^7.32.0",
812
"mini-css-extract-plugin": "^2.3.0",
@@ -12,8 +16,8 @@
1216
"dependencies": {
1317
"bootstrap": "^3.4.0",
1418
"clipboard": "^2.0.8",
15-
"jquery": "^3.6.0",
1619
"event-source-polyfill": "^1.0.25",
20+
"jquery": "^3.6.0",
1721
"xterm": "^4.14.1",
1822
"xterm-addon-fit": "^0.5.0"
1923
},

webpack.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ module.exports = {
2323
],
2424
module: {
2525
rules: [
26+
{
27+
test: /\.js$/,
28+
exclude: /(node_modules|bower_components)/,
29+
use: {
30+
loader: 'babel-loader',
31+
options: {
32+
presets: ['@babel/preset-env'],
33+
}
34+
}
35+
},
2636
{
2737
test: /\.css$/i,
2838
use: [

0 commit comments

Comments
 (0)