[Vuejs]-My main.css is not rendering,I am using multiple entry points webpack.config

0👍

you forgotten to put {% render_bundle 'back_office' 'js' %} in the body of your part of the html file

your file could look like this

{% load render_bundle from webpack_loader %}
{% load static %}

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <!-- YOU COULD INCLUDE STATIC CSS FILES LIKE ... -->
    <link rel="stylesheet" type="text/css" href='{% static "/css/fontawesome5.8.1/all.min.css" %}'>
    <link rel="stylesheet" type="text/css" href='{% static "/css/bootstrap4.3.1/bootstrap.min.css" %}'>

    <title>YOUR TITLE</title>

    {% render_bundle 'first_entry_point' 'css' %}
  </head>
   <body>
    <!-- YOU COULD INCLUDE STATIC JS FILES LIKE JQUERY ... -->
    <script src='{% static "/js/jquery-3.4.1.min.js" %}' type="text/javascript"></script>
    <script src='{% static "/js/bootstrap4.3.1/bootstrap.bundle.min.js" %}' type="text/javascript"></script>
    <div id="react-app" style="height:100%;"></div>
    {% render_bundle 'first_entry_point' 'js' %}
  </body>
</html>

and in the webpack.config.js you could have the entrypoints like

.
.
.
module.exports = {

  mode: "development",
  entry: {
    first_entry_point: path.join(__dirname, "...first_entry_point..."),
    second_entry_point: path.join(__dirname, "...second_entry_point...")
  },
.
.
.

Leave a comment