How to webpack? (in nextjs)
I can do what I want to do super easy in rollup but I can't for the life of me figure out how to do it in webpack.
Essentially all I want to do is run my source code through a tool to transform it before it's compiled.
My source code is in TypeScript but my tool only works with JavaScript, so I need to add the transformation after the the TypeScript transpilation.
I created a webpack loader that seem to work fine for js file, but I don't know how to get it to work for ts files too.
This is what I've got so far:
Is this something that can be done in webpack, hopefully somewhat easily?
2 Replies
The tool for reference if it's relavent: https://github.com/RebeccaStevens/deassert
GitHub
GitHub - RebeccaStevens/deassert: Allows for programming with asser...
Allows for programming with assertions/invariant-based programming during development without slowing down production. - RebeccaStevens/deassert
I did manage to figure this out eventually with a bit of trial and error. It's not the prettiest but it works: