influxdata / influxdata/giraffe

Webpack: absolute file paths for imports

Open
#795 1 comment 0 reactions 0 assignees View on GitHub
kind/tech debt team/dumplings team/ui
Dominant language
TypeScript
Stars
189
Forks
33
Avg merge
3d 15h
Merged PRs (30d)
4

Description

Updating webpack's config to use absolute paths in our imports seems easy, but it doesn't appear to work.

Currently, we already have this in `webpack.common.config.js`:

```
module.exports = {
// ...
resolve: {
alias: {
src: path.resolve(__dirname, 'src'),
},
```

However, attempting to use `src/utils/useCanvas` in an import statement will cause a build error, for example. There must be some other configuration or property that is not set correctly.

Contributor guide

Open the contributing guide

Research direction

Start in webpack.common.config.js by inspecting the resolve.alias configuration and reproduce the build error with an import such as src/utils/useCanvas. The work is done when imports using the src/ path build successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.