Skip to content

Commit c3bd87b

Browse files
committed
chore(babel): add optional-chaining and nullish-coalescing
1 parent 08d967b commit c3bd87b

File tree

4 files changed

+67
-19
lines changed

4 files changed

+67
-19
lines changed

babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ module.exports = {
3333
],
3434
'@babel/plugin-proposal-export-default-from',
3535
'@babel/plugin-proposal-export-namespace-from',
36-
'@babel/plugin-proposal-object-rest-spread',
36+
'@babel/plugin-proposal-nullish-coalescing-operator',
37+
'@babel/plugin-proposal-optional-chaining',
3738
'lodash'
3839
],
3940
env: {

package-lock.json

Lines changed: 59 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
"@babel/plugin-proposal-decorators": "^7.8.3",
133133
"@babel/plugin-proposal-export-default-from": "^7.8.3",
134134
"@babel/plugin-proposal-export-namespace-from": "^7.8.3",
135-
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
136-
"@babel/plugin-transform-exponentiation-operator": "^7.8.3",
135+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
136+
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
137137
"@babel/plugin-transform-runtime": "^7.8.3",
138138
"@babel/plugin-transform-strict-mode": "^7.8.3",
139139
"@babel/preset-env": "^7.8.3",

rollup.config.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ export default {
1818
postcss({
1919
modules: {
2020
generateScopedName: (name, filename, css) => {
21-
let componentName;
2221
const cssHash = base64.encode(css).substring(0, 8);
2322
const paths = filename.split('/');
24-
let index = paths.indexOf('@ciscospark');
25-
26-
if (index === -1) {
27-
index = paths.indexOf('@webex');
28-
}
23+
const index = paths.indexOf('@webex');
24+
let componentName;
2925

3026
if (index !== -1) {
3127
componentName = paths[index + 1];
@@ -61,8 +57,8 @@ export default {
6157
legacy: true
6258
}
6359
],
64-
'@babel/plugin-proposal-object-rest-spread',
65-
'@babel/plugin-transform-exponentiation-operator'
60+
'@babel/plugin-proposal-nullish-coalescing-operator',
61+
'@babel/plugin-proposal-optional-chaining'
6662
],
6763
presets: [
6864
'@babel/preset-react'

0 commit comments

Comments
 (0)