Skip to content

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

Merged
meganindya merged 4 commits into
sugarlabs:sadn1ck/gsoc-2022from
sadn1ck:sadn1ck/week-1
Sep 8, 2022
Merged

tooling: webpack setup, prod/dev typed configs, remove CRA [week 1]#194
meganindya merged 4 commits into
sugarlabs:sadn1ck/gsoc-2022from
sadn1ck:sadn1ck/week-1

Conversation

@sadn1ck

@sadn1ck sadn1ck commented Jun 19, 2022

Copy link
Copy Markdown
Contributor

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)

sadn1ck added 4 commits June 13, 2022 15:28
* 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.

2 participants