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

tooling: webpack setup, prod/dev typed configs, remove CRA [week 1] #194

Merged
merged 4 commits into from Sep 8, 2022

Conversation

sadn1ck
Copy link
Contributor

@sadn1ck sadn1ck commented Jun 19, 2022

Changes:

  • add webpack 5, webpack dev server and webpack merge
  • enabled fully typed webpack configs
  • dev and prod webpack configs under webpack/
  • proper webpack config loaded in correct env
  • add loaders for scss, png, svg and tsx files
    • babel toolchain for js/ts
    • mini-css-extract-plugin, css-loader and sass loader for css
  • remove craco, react-scripts
  • remove CRA specific path from index.html
  • use copy-webpack-plugin to copy from public to build
  • ignore copying index.html in public as html-webpack-plugin uses that a template and generates one for us already

Points to note:

  • current build output assumes index.html will be in the same folder as other build outputs
    • basically index.html hardcodes relative path to meta icons (favicon, etc) as /icon/filename.png
    • goal is to have it dynamically configurable at build time to allow flexibility in hosting on a static file host or under an actual web server
  • all svgs are currently inlined using webpack's loader

Current build is hosted at: https://sadn1ck.github.io/musicblocks-v4/

  • Functionality working, but icons are dropped due to public path issues (currently working on that)

* add webpack 5, webpack dev server and webpack merge

* enabled fully typed webpack configs

* dev and prod webpack configs under webpack/

* proper webpack config loaded in correct env

* add loaders for scss, png, svg and tsx files

* remove craco, react-scripts

* remove CRA specific path from index.html

Signed-off-by: Anik Das <anikdas0811@gmail.com>
* switch to named exports for webpack configs

Signed-off-by: Anik Das <anikdas0811@gmail.com>
* use copy-webpack-plugin to copy from public to build

* ignore index.html in public as html-webpack-plugin uses that as
  template and generates one for us already

Signed-off-by: Anik Das <anikdas0811@gmail.com>
* for html-webpack-plugin
* for mini-css-extract-plugin
* remove redundant output config
* document final config function

Signed-off-by: Anik Das <anikdas0811@gmail.com>
@meganindya meganindya merged commit fed98fe into sugarlabs:sadn1ck/gsoc-2022 Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants