Skip to content

Commit eeb42a2

Browse files
committed
[CHORE] Use babel to reference absolute paths
This alternative option to getting absolute paths in our JS has the benefit of the paths being relativized on build.
1 parent c6e4ab3 commit eeb42a2

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
],
66
"plugins": [
77
"@babel/plugin-proposal-object-rest-spread",
8+
["module-resolver", {
9+
"alias": {
10+
"src": "./src",
11+
"scss": "./scss"
12+
}
13+
}]
814
],
915
"env": {
1016
"production": {

.storybook/webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,5 @@ module.exports = function({ config }) {
77
include: path.resolve(__dirname, '../')
88
});
99

10-
config.resolve.modules = [
11-
...(config.resolve.modules || []),
12-
path.resolve('./'),
13-
];
14-
1510
return config;
1611
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"polished": "^3.4.2",
1313
"prop-types": "^15.7.2",
1414
"react-bootstrap": "^1.0.0-beta.16",
15-
"react-transition-group": "^4.3.0",
1615
"react-copy-to-clipboard": "^5.0.2",
1716
"react-popper": "^1.3.7",
1817
"react-select": "^3.0.8",
1918
"react-tracking": "^7.3.0",
19+
"react-transition-group": "^4.3.0",
2020
"uuid": "^7.0.2"
2121
},
2222
"scripts": {
@@ -66,6 +66,7 @@
6666
"@testing-library/react-hooks": "^3.2.1",
6767
"babel-eslint": "^10.0.3",
6868
"babel-loader": "^8.0.6",
69+
"babel-plugin-module-resolver": "^4.0.0",
6970
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
7071
"babel-preset-react": "^6.24.1",
7172
"css-loader": "^3.4.2",

yarn.lock

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,6 +3120,17 @@ babel-plugin-minify-type-constructors@^0.4.3:
31203120
dependencies:
31213121
babel-helper-is-void-0 "^0.4.3"
31223122

3123+
babel-plugin-module-resolver@^4.0.0:
3124+
version "4.0.0"
3125+
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.0.0.tgz#8f3a3d9d48287dc1d3b0d5595113adabd36a847f"
3126+
integrity sha512-3pdEq3PXALilSJ6dnC4wMWr0AZixHRM4utpdpBR9g5QG7B7JwWyukQv7a9hVxkbGFl+nQbrHDqqQOIBtTXTP/Q==
3127+
dependencies:
3128+
find-babel-config "^1.2.0"
3129+
glob "^7.1.6"
3130+
pkg-up "^3.1.0"
3131+
reselect "^4.0.0"
3132+
resolve "^1.13.1"
3133+
31233134
babel-plugin-named-asset-import@^0.3.1:
31243135
version "0.3.6"
31253136
resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.6.tgz#c9750a1b38d85112c9e166bf3ef7c5dbc605f4be"
@@ -5575,6 +5586,14 @@ finalhandler@~1.1.2:
55755586
statuses "~1.5.0"
55765587
unpipe "~1.0.0"
55775588

5589+
find-babel-config@^1.2.0:
5590+
version "1.2.0"
5591+
resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.2.0.tgz#a9b7b317eb5b9860cda9d54740a8c8337a2283a2"
5592+
integrity sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA==
5593+
dependencies:
5594+
json5 "^0.5.1"
5595+
path-exists "^3.0.0"
5596+
55785597
find-cache-dir@^2.0.0, find-cache-dir@^2.1.0:
55795598
version "2.1.0"
55805599
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7"
@@ -5952,7 +5971,7 @@ glob-to-regexp@^0.3.0:
59525971
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
59535972
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
59545973

5955-
glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@~7.1.1:
5974+
glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.1:
59565975
version "7.1.6"
59575976
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
59585977
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
@@ -7613,6 +7632,11 @@ json3@^3.3.2:
76137632
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81"
76147633
integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==
76157634

7635+
json5@^0.5.1:
7636+
version "0.5.1"
7637+
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
7638+
integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=
7639+
76167640
json5@^1.0.1:
76177641
version "1.0.1"
76187642
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
@@ -10548,6 +10572,11 @@ requires-port@^1.0.0:
1054810572
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
1054910573
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
1055010574

10575+
reselect@^4.0.0:
10576+
version "4.0.0"
10577+
resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7"
10578+
integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA==
10579+
1055110580
resize-observer-polyfill@^1.5.1:
1055210581
version "1.5.1"
1055310582
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"

0 commit comments

Comments
 (0)