Open ash-bergs opened 2 months ago
https://www.npmjs.com/package/webpack-merge - notes on using TS here, should work relatively out-of-the-box?
https://github.com/webpack/webpack-cli/issues/1993 - an issue with the same error I faced above, but adding ts-node didn't seem to get me past it 🤔
https://www.npmjs.com/package/webpack-dev-server - more notes on TS use, the devServer
option doesn't exist on the native webpack Configuration
object, so we need to support it specially
We added more complexity to our bundling in: https://github.com/ash-bergs/pantry-pal/pull/33
A dev and prod webpack config were added, allowing us to skip the service worker for local environments, but trying to move the webpack files to ts came with some errors.
Relevant comment from this PR:
I don't love using the
require
syntax and js here... and I originally built all of these configs with ts, like:This was nice because we get a lot of type safesty from webpack itself - but I kept running into issues with compiling:
and
and
I updated the
ts.config
, tweaked module rules, addedts-node
, changed thetarget
in the common config.... It seemed like everything I did solved one issue, but then gave me another.Converting to js and using
require
got me around those errors, and gets everything building as desired.But I know this is a solveable issue, I suspect my issue is most likely in the
ts.config
- there's something set, or not set. I will make an issue for this and dig into the config to see if I can't return ts and all the nice type support we get from it.