Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use webpack alias #3707

Merged
merged 38 commits into from
Sep 18, 2019
Merged

Use webpack alias #3707

merged 38 commits into from
Sep 18, 2019

Conversation

thekp
Copy link
Contributor

@thekp thekp commented Sep 11, 2019

Resolves #2567

Overall change:
This continues the work from this PR: #3542
Uses webpack directory aliasing previously set up in #3318
Cypress is not using the Aliases because it can not properly compile the aliases without webpack config

Code changes:

  • create a file that contains all the alias and it's formatting in an object to be imported in various places (webpack config, eslint config and jest config)
  • updated files that can use the alias

  • I have assigned myself to this PR and the corresponding issues
  • Automated (jest and/or cypress) tests added (for new features) or updated (for existing features)
  • This PR requires manual testing

@thekp thekp added this to the Simorgh 2.0 milestone Sep 11, 2019
@thekp thekp self-assigned this Sep 11, 2019
@thekp thekp added this to PR in Progress in Simorgh via automation Sep 11, 2019
@thekp thekp moved this from PR in Progress to Code review in Simorgh Sep 12, 2019
@mykeels
Copy link
Contributor

mykeels commented Sep 12, 2019

Are all aliases relative to the project root directory?

@thekp
Copy link
Contributor Author

thekp commented Sep 12, 2019

Are all aliases relative to the project root directory?

Yes ^

@mykeels
The webpack aliases are relative to the root of Simorgh because of the functionality here: https://github.com/bbc/simorgh/pull/3707/files#diff-9aa58844b835b1672134e3b1a55da686R1-R9

The jest alias is also relative to the root because of the <rootDir> tag used.
jest doc:https://jestjs.io/docs/en/configuration#modulenamemapper-object-string-string

@dr3
Copy link
Contributor

dr3 commented Sep 16, 2019

Missing alias usage in simorgh/src/app/routes/getInitialData/utils/getRouteProps/index.js 🙈

Copy link
Contributor

@dr3 dr3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked tests, eslint, storybook. npm run dev and npm run build LGTM, great work

Simorgh automation moved this from Code review to Ready for merge Sep 16, 2019
Copy link
Contributor

@FK78 FK78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-hinds chris-hinds merged commit 1e3b237 into latest Sep 18, 2019
Simorgh automation moved this from Ready for merge to Done Sep 18, 2019
@chris-hinds chris-hinds deleted the UseWebpackAlias branch September 18, 2019 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add webpack directory aliasing
7 participants