Skip to content
Advertisement

Tag: webpack-dev-server

How to provide contentBase and publicPath in wepack-Dev-server

Recently i setup a webpack-dev-server by watching a tutorial. I did exactly what exactly he did in the video I expected that It will start a Live server, but it didn’t. I already check the internet but nothing good happenedenter image description here Answer Please refer to this link: https://webpack.js.org/configuration/dev-server/#publicpath Since Webpack has been migrated from v3 to v4 so

Error: Cannot find module – webpack-dev-server.js

I am building a react app from scratch. Usually, I am running the npm create-react-app and it generates everything for you. I am following this tutorial https://www.youtube.com/watch?v=deyxI-6C2u4&ab_channel=TraversyMedia and it has the GitHub repository in the description. The problem is – when i run “npm start” it should run this command which is written here in the package.json The command works

Webpack dev server and WebSockets

Three quick questions: 1) Knowing full well the benefits of Socket.io, I still wanna know if it is possible to run a single webpack-dev-server that can server both http and ws. Everything online is oriented to using Socket.io and running dual servers for http / ws. 2) If indeed I must use Socket.io, how does local development (http server and

Django/Webpack – How to serve generated webpack bundles with webpack dev server

Django’s ‘static’ tag generates urls using STATIC_URL, which results in something like ‘/static/myapp/js/bundle.js’ Mean while, webpack-dev-server is serving bundles from the url ‘localhost:3000’ My question is how do I get Django ‘static’ template tag to generate a different url ( which points to webpack dev server) for js bundles. Of course I can hardcode it in the template, but that

Exclude var and json file from webpack build

I’m trying to exclude but retain external reference to a few JSON files from a webpack build. I’ve modified the webpack.config.js to include: This solved some previous errors, but now it seems that the ‘font’ var is being considered undefined. The error is referring to this line in the build, where webpack has exported the ‘font’ var as a module.export:

Webpack-dev-server not bundling even after showing bundle valid message

I’ve set up a basic react application with webpack but I couldn’t get the webpack-dev-server running properly. I’ve installed webpack-dev-server globally and tried running the command sudo webpack-dev-server –hot as hot reloading was required. The project seems to be working fine with just webpack cmd. It builds into my build folder and I can get it working via some server

Advertisement