Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ian
    @IanT8

    Could someone please explain this code fragment from the webpack.config.js in the examples/hot-reload folder:

    {
      entry: [
          'webpack-dev-server/client?http://localhost:3000',
          'webpack/hot/only-dev-server',
          './assets/js/index'
      ]
    }

    I don't know what the first and second entry points are doing.

    Ian
    @IanT8
    I've got this hot-reload example working, but seems I have to run 3 consoles, (1) webpack --watch (2) python manage.py runserver and (3) node server.js. Is that right? It still doesn't seem to reload when I edit and save the "Hello World" message in assets/js/app.jsx. I'm puzzled.
    Ian
    @IanT8
    I discovered a CORS issue. To fix, I added headers: { "Access-Control-Allow-Origin": "*" } to server.js after the historyApiFallback: true, line.
    Ian
    @IanT8
    And only (1) python manage.py runserver and (2) node server.js are needed.
    François GUÉRIN
    @frague59
    Hi
    I'm new with webpack technology, and I've to upgrade a project to use it
    I've build the site arround jQuery / bootstrap 3, and a custom bunch of css (bs overridings) and js (forms)
    I've followed the http://owaislone.org/blog/webpack-plus-reactjs-and-django/ tutorial, but I does not understand where to put my own assets and how to "ask" to webpack to package them
    François GUÉRIN
    @frague59
    I also use a bunch of django apps, will they be bundled too ?
    Thanks for your help !
    Salar Rahmanian
    @softinio
    @frague59 great question I am trying to figure our the same hope someone here can help
    konoufo
    @konoufo
    It's pretty straight forward, there is an entry property in you webpack config. That's where you list all the files webpack bundles.
    konoufo
    @konoufo
    @frague59 Do you have static files in those django apps that you need to bundle ? If so you'll have to put those paths as well inside the entry property. To know what entryexpects see https://webpack.js.org/concepts/entry-points/
    Salar Rahmanian
    @softinio
    @konoufo do I have to list each file one by one or can I list directories?
    assume in addition to that need to add the appropriate loader like if its css files i need to add the css loader ?
    konoufo
    @konoufo
    @softinio You can't just list a directory unless you have an index.js file there that requires everything you need in that directory. But you could also use glob to do something like this:
    var glob = require("glob");
    // ...
    entry: glob.sync("./myfolder/**")
    Salar Rahmanian
    @softinio
    @konoufo thx for info
    Salar Rahmanian
    @softinio
    in my webpack config I am importing the css files I want included in the bundle by importing them in the entrypoint index.js file
    in my django template how do I access the different css files?
    ie how do I have the css files included
    I have added this to my template head: {% render_bundle 'main' 'css' %}
    but nothing appears
    any help really appreciate as clearly I am doing something wrong :-)
    konoufo
    @konoufo
    Did you actually build ? @softinio
    Salar Rahmanian
    @softinio
    yes
    Salar Rahmanian
    @softinio
    I have tried adding the css to entrypoint and as imports in the index.js file and neither work for me :(
    @konoufo
    ^^
    really appreciate your help
    konoufo
    @konoufo
    hum ok. can you upload you webpack-stats.json and webpack.config.js somewhere ?
    and put links here @softinio
    we help each others out :smile:
    Wojciech Niedźwiedź
    @Niedzwiedzw
    oh
    it's dead
    Pavel Tyurikov
    @paveltyurikov
    Hi, I was using webpack_loader with create-react-app configs and works fine with webpack 3. Now when I want to update to create-react-app 2.0.3 with webpack 4 it won't work :(
    Eray Erdin
    @erayerdin
    Hi everybody, I've seen this project supports Django>=1.6, which, to me, appeared too broad considering that we have 1.10, 1.11, 2.2 and 3.0 releases here. So, my question is, does it support Django 2.2?