Webpack - ignore loaders in require()?

You can add two exclamation to ignore loaders in the webpack config file

!!raw!file.ts

one exclamation will only disable preloaders!

https://webpack.js.org/concepts/loaders/#inline


As far as I know that is the only way you are going to be able to load a file in two different ways. I expect the issue is that your paths are different in your production build.

I would suggest running webpack with the --display-error-details flag to get more info on why it fails.