Using Express, Webpack and Bootstrap. I'm using css-loader
for stylesheets.
Here's my webpack.config.js
:
const path = require("path");
config = {
"entry": "./modules/entry.js",
"output": {
"path": path.resolve(__dirname, "public"),
"filename": "bundle.js"
},
"module": {
"rules": [
{ "test": /\.css$/, "use": "css-loader"}
]
}
}
module.exports = config
Entry.js only requires the stylesheets:
require("bootstrap")
require("glyphicons")
I put all these files in my public folder which I serve using app.use(express.static("public"))
And in my index.html I have a script tag:
<script src="./public/bundle.js" type="text/javascript">
Using bootstrap classes (or glyphicons) on my html does nothing.