vortigern
vortigern copied to clipboard
Order of vendor imports
Hi, shouldn't the order of vendor asset imports (Bootstrap 4 for example) be different? For instance, I was trying to apply a className to an HTML element and the classes from Bootstrap overrode my custom styles for the element. Most likely because I applied my custom styles first, but then overrode them by Bootstrap 4 styles.
Here's my Bootstrap 4 import in this file src\vendor\main.ts:
require('./bootstrap/bootstrap.min.css')
And I had to change the order in config\webpack\dev.js from this:
entry: {
app: [
'webpack-hot-middleware/client?reload=true',
'./src/client.tsx',
'./src/vendor/main.ts'
]
},
to this (note that the path to vendor main.ts file is earlier in the list than the client):
entry: {
app: [
'webpack-hot-middleware/client?reload=true',
'./src/vendor/main.ts',
'./src/client.tsx'
]
},
Similarly, I had to modify config\webpack\prod.js. So what do you think? Shouldn't this order be a default one in this repo?
Thanks.
This is a good point, I couldn't get my custom styles to work at all, and resorted to a hack using Helmet and just including the bootstrap css from CDN in <head>
...