liamrdawson / photography-v2.0

A modern photography website leveraging TypeScript, Next and React. Using my custom built component library based on Atomic Design principles.
1 stars 0 forks source link

[BUILD]/Next-Storybook-Typescript-Config #14

Open liamrdawson opened 3 years ago

liamrdawson commented 3 years ago

[BUILD] Request - Next + Storybook + Typescript Config

Is your build request related to a problem? Please describe. No

Describe the solution you'd like The project currently has a somewhat fragile build due to the fact that Storybook and NextJS each have their own config of Webpack 'under the hood'. This means that they sometimes treat certain libraries or files slightly differently (e.g. the way images are handled, the way Typescript is treated, the way relative/absolute file paths are managed).

This build request is to reconfigure the projects Webpack setup so that both Storybook and NexJS are reading a shared extended Webpack config to ensure that issues like those mentioned above are handled in a unified manner.

Describe alternatives you've considered I have so far been trying to manage the two libraries separately, however this has over time become a cumbersome process.

Additional context Frontend Masters - Webpack Fundamentals Webpack - Configuration NextJS Docs - Custom Webpack Config Storybook - Webpack

Acceptance Criteria

  1. The Webpack build is extended and managed from a single Webpack config file.
  2. No new errors are produced.

Optional additional items

Issue default title: Assignees: Labels:

liamrdawson commented 3 years ago

Rather than try to bend Next and Storybook to each adhere to the same webpack config, it might be better to separate these concerns into their own respective packages as the application and the components library will each have their own specific requirements.

Next I will investigate splitting out the components as their own package and consuming them within this project.