Skip to content

Commit

Permalink
Allow absolute import paths everywhere (cruise-automation#661)
Browse files Browse the repository at this point in the history
We already enabled this in the closed-source repo, but let's add it here as well.
This allows all code to import using paths like `import X from "webviz-core/any/path"`.

This allows script files like `record-local-bag-video.js` to use absolute import paths as well.

Co-authored-by: Chris Hasson <[email protected]>
  • Loading branch information
hassoncs and hassoncs authored Jul 26, 2021
1 parent c96eb4a commit 4dcd47d
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 40 deletions.
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ module.exports = {
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-syntax-dynamic-import",
["@babel/plugin-proposal-object-rest-spread", { useBuiltIns: true }],
// module-resolver allows us to use absolute import paths
["module-resolver", { root: ["packages"] }],
],
};
143 changes: 112 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"babel-eslint": "^10.0.1",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.4",
"babel-plugin-module-resolver": "^4.1.0",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"css-loader": "^1.0.1",
"enzyme": "^3.9.0",
Expand Down
Loading

0 comments on commit 4dcd47d

Please sign in to comment.