Example of how to load static CSS files from node_modules using webpack?

For users who have encountered a similar problem, there are steps that I’ve done to get it working, I’m not sure that this equilibrium way. npm install file-loader –save add import ‘leaflet/dist/leaflet.css’; in main app.js change webpack.config.js by following way: add css-loader to get rid of SyntaxError: Unexpected token . and next add file-loader and … Read more

Webpack “OTS parsing error” loading fonts

TL;DR Use absolute paths to your assets (including your complete hostname) by setting your output.publicPath to e.g. “http://example.com/assets/“. The problem The problem is the way that URLs are resolved by Chrome when they’re parsed from a dynamically loaded CSS blob. When you load the page, the browser loads your Webpack bundle entry JavaScript file, which … Read more