Questions tagged [webpack-dev-server]

1

votes
1

answer
84

Views

Reference js file using webpack

I am new to webpack, and am using it to compile my Elm project. I have the following configuration file var path = require('path'); module.exports = { entry: { app: [ './src/index.js' ] }, output: { path: path.resolve(__dirname + '/dist'), filename: '[name].js', }, module: { rules: [ { test: /\.(cs...
Murdock
1

votes
1

answer
1.5k

Views

Is there a way to let webpack dev server use another port?

I'm using the webpack dev server, via the react scripts and I'd like to use the debugging functionality it offers via Visual Studio Code, however, I have a non-standard setup. We have service in front of the webpack dev server that proxies all requests, bundles requests with other services, handles...
Alex
1

votes
1

answer
82

Views

[email protected] hot reload NOT working properly?

starting webpack-dev-server --hot i see the code run to client/index.js: log('info', '[WDS] App hot update...'); console.log('window object',currentHash); //printed window.postMessage('webpackHotUpdate' + currentHash, '*'); but not triggering below dev-server code: hotEmitter.on('webpackHotUpdate',...
user9122693
1

votes
0

answer
226

Views

Adding hashes to filenames in Angular 2 apps for Production, not Dev with web pack

I’m trying to add a hash to my app.js filenames for production builds only and am having trouble configuring webpack to do this AND still leave incremental builds with the webpack-dev-server functional. For development, hashes break the incremental builder and the webpack-dev-server, so it's crit...
Stephen R. Smith
1

votes
0

answer
264

Views

How to use webpack to create a front end and a admin?

I am actually new on node.js. I am trying to create an app with admin and frontend using webpack and express. I have created an example app but now the problem is how I can create the app with the admin. Below I have shared my webpack config file var webpack = require('webpack'); var path = require(...
Tareq Aziz
1

votes
0

answer
463

Views

Webpack CSS not being rendered in production environment

I have created a Vuejs project using Webpack bundler. Everything works out fine for my local as it's injecting the CSS to the tag. But for some reason once i do npm run build, which consist of the following command cross-env NODE_ENV=production webpack --progress --hide-modules, it somehow doesn't...
Jeiman
1

votes
0

answer
224

Views

Webpack Hot Reload Infinite Refresh in Chrome

I'm having a strange hot reloading issue that I think is related to my environment, but I can't track down what is. I was hoping someone else had run into it and could point me in the right direction. I've been banging my head on this one for a couple days now. I'm running dev webpack locally (Mac)...
cgray9
1

votes
1

answer
205

Views

Is it possible to get webpack-dev-server to ignore all but a certain path in the proxy settings?

I've got my WDS running on port 9000, and the webpack bundles located under /dist/ I've got a back end server running on port 55555 Is there a way to get WDS to ignore (proxy to 55555) every call except those starting with /dist/? I've got the following: devServer: { port: 9000, proxy: { '/dist': '...
Eric
1

votes
1

answer
1.7k

Views

How to use webpack DLL Plugin?

I am just starting to use webpack 3 and dllplugin. I managed to find a few blog articles abt. this. However none of them with a proper code sample/ GitHub samplecode. Does anyone know any references to sample code for this/ working example?
bier hier
1

votes
0

answer
18

Views

Is it possible to alter the json response from inside a webpack proxy?

I am calling an api which returns much more data than I need, and in an ugly json format. I would like to be able the map the response to return something nicer. For example if I am only interested in the customer name, I would like to do something like: '/api': { target: 'http://test.com/', onPro...
Buh Buh
1

votes
1

answer
606

Views

How to deploy react-native-web app into heroku?

I am trying to use react-native-web in my college project. I've following steps here and successfully create a dev version of react-native-web app. I want to deploy my app onto Heroku, after searching many questions, I still can't run my app on Heroku. It always crashed after 60 seconds after start...
Syahrul Ardiansyah
1

votes
0

answer
248

Views

Deploy complete but nothing shows up on Herokuapp site; React Webpack app

I am trying to deploy my React Webpack app on Heroku and am going through some basic steps such as editing my scripts on my package.json. I have added the 'postinstall' and 'start' scripts, created a server.js file. Here is my package.json (I have done sudo NPM install -g webpack, and npm install,...
bigmugcup
1

votes
0

answer
86

Views

How can I get through mac firewall to let my mobile device access webpack dev server?

I have a dev server running in an Angular 5 cli-project at localhost:4200 through webpack-dev-server. I want to connect my iphone to the dev server for testing. It uses the same wifi SSID as my computer. I'm using the computer's registered name in safari's url field in the iphone: jonathans-macbook-...
Jonathan002
1

votes
0

answer
1.7k

Views

WebSocket connection to 'ws://localhost:4000/sockjs-node/612/2pdjfv15/websocket' failed: Connection closed before receiving a handshake response error

I'M using Browser Sync with webpack-dev-server, And facing the issue while using browser sync..!! only form fill up is working, click, scroll is not working in browser sync, and there is no any compile time error occurring, But above things are not working..!! Here is my 'Webpack.dev.js' file, So wh...
Chintan Sukhadiya
1

votes
0

answer
83

Views

Change webpack dev server entry points at runtime

I'd like to make Webpack dev server a little more robust about adapting to my build when switching between branches. I can detect when entry point files are added or removed, however I don't see any obvious way to update Webpack dev server with new entry point config. Is there a way to define new en...
user3233362
1

votes
0

answer
327

Views

AngularJS 1.6 + Webpack dev server - “Module 'app' is not available!”

I'm trying to set up a simple AngularJS app with webpack dev server, but I can't get angular to work. HTML is being served up fine. I'm getting the errors 'Uncaught Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it...' 'Uncaught Error...
killer_manatee
1

votes
0

answer
220

Views

How to watch new entry files with webpack?

I have webpack.config.js which produces html files corresponding to each pug-source template: const glob = require('glob'); module.exports = { entry: glob.sync('src/*.pug').reduce((acc, value) => { acc[value] = './' + value; return acc; }, {}), output: { filename: '[name].js', publicPath: '/' }, mo...
andrew
1

votes
0

answer
726

Views

Webpack dev server proxy not working

I am trying to set webpack dev server proxy. However, I am getting following error: 500 - Error occurred while trying to proxy to: localhost:8080/abc/v1/user/search/?id=123122 Here is my webpack devserver config: proxy:  { '^/abc/v1/**':  'https://my-services.net/', changeOrigin: true, secure: fal...
Vishal Gulati
1

votes
1

answer
464

Views

Webpack proxy, how to redirect when url end with specific path?

I'd like that when i try to access this URL : http://localhost:8080/123456/activites-digitales Proxy redirect request to this address : http://localhost:8082/activites-digitales I have an api on port 8082 which return JSON. With my current config file it work for : http://localhost:8080/activites-d...
Nolyurn
1

votes
0

answer
195

Views

How can I get arbitrary command line arguments past yarn and webpack-dev-server?

I'm building an Electron-based command line tool. Users will invoke it from the command line, and then it'll open a normal Electron window (which is why I'm bothering with Electron & webpack, instead of using something simpler like nexe), influenced by what they entered via CLI. I'm using webpack-de...
Tom
1

votes
0

answer
221

Views

Cannot statically analyse 'require(…, …)' while bundling coffeescript and backbone application using Webpack

I am trying to migrate from grunt to webpack in a backbone/coffeescript project. While bundling, I'm getting error Cannot statically analyse 'require(…, …)' for require statement in which dependencies are known at run time. To handle above, I'm using webpack ContextReplacementPlugin. Below is c...
pooja singh
1

votes
1

answer
188

Views

BrowseRouter MIME type error

I have react application with react-router, how you can see in the title, I use BrowserRouter, and have the following error (image): Refused to apply style from 'http://localhost:8000/public/login/main.bfa4608...css' because its MIME type {'text/html'} is not a supported stylesheet, and strict MIME...
R3tter
1

votes
0

answer
345

Views

Multiple Entry Point on Webpack by express js

I want to use multiple entry point of webpack using express js instances in react boilerplate for two different application with sharable codebase I have two html and two js files vendor.html for vendor.js and settings.html for settings.js. One Server.js with two instances of express `Server.js co...
Rohit Dubey
1

votes
0

answer
499

Views

React Webpack is not working in IE11 in production

My application is not rendering in IE11 in production(Works in chrome) . I am using the react webpack and Getting the error like this in chrome console because of webpack in production . Suggest me to debug this bug SCRIPT1002: Syntax error vendor.js (1,268483) Version 'webpack': '^2.2.1', 'webp...
Naveen Kumar
1

votes
0

answer
63

Views

How to let webpack dev server check whether the client is desktop or mobile and respond different htmls?

I'm writing a React app and it needs to adapt the desktop end and the mobile end. There're so many components in my app that I have to build a new page to send it to mobile devices. That is, the desktop and mobile browsers get different index htmls when the user visit the same index url, eg localhos...
enzeberg
1

votes
2

answer
33

Views

Can you set an alias in webpack which will replace all matching occurrences in all files and not just requires?

I'm trying to configure my react app for easy branding and styling, there are some hardcoded branding strings which I don't want to use store for, and I don't want to have to pass properties through all components for branding. But I'd like to be able to change some of the strings globally at a whi...
nikolaj frey
1

votes
1

answer
1.6k

Views

webpack-dev-server builds and rebuilds very slow

My webpack-dev-server gets work very slow. I have the following webpack.config.js file: 'use strict'; var path = require('path'); var webpack = require('webpack'); var glob = require('glob'); module.exports = { entry: { wit: [babel-polyfill', './index.js', './src/shared/styles.less'] }, output:...
Roman
1

votes
0

answer
416

Views

Webpack 4 watch content base not working

I'm using webpack 4.7 and for some reason the page isn't refreshing when I make changes. I can see my scss/css recompile but it doesn't trigger a refresh, the same for index.html I'm using commands via the package.json: 'dev': 'webpack-dev-server --open --mode development --watch-content-base js/ind...
Michael Harper
1

votes
0

answer
383

Views

Setting a cookie with a webpack-dev-server client and hapi API

I have a ReactJS client running webpack-dev-server on localhost:3000. It connects to a Hapi API server on localhost:8080 and I'm trying to provide a basic cookie using hapi-auth-jwt2 (I've also tried hapi-auth-cookie with equal results). I can see the response header provides a valid set-cookie head...
Michael
1

votes
1

answer
279

Views

After updating webpack-dev-server and webpack some modules are requested but doesn't exist

My project uses Vue.js and Typescript. I updated webpack and webpack-dev-server and now some modules are missing when I try to run in development mode. More info: My packages versions: 'npm': '6.0.0', 'webpack': '^4.8.1', 'webpack-cli': '^2.1.3', 'webpack-dev-server': '^1.16.5' Command to run app in...
Felipe Garcia
1

votes
0

answer
53

Views

Cannot point to the right bundles because of the base

I have a mean-stack website, and in index.html I have . I am trying to follow this to integrate the ESM version of the Monaco Editor by using plain webpack. I can successfully generate all the bundle files in dist folder. Now, in app.js I add app.use(express.static(path.join(__dirname, 'dist'))) an...
SoftTimur
1

votes
0

answer
53

Views

cannot read property 'createResolver' of undefined

C:\Users\VM-OUT-Kramar-YA_ALL\OPERATION\bfs-bvfo-br-pl\node_modules\webpack-dev-server\bin\webpack-dev-server.js:373 throw e; TypeError: Cannot read property 'createResolver' of undefined at WebpackOptionsApply.process (C:\Users\VM-OUT-Kramar-YA_ALL\OPERATION\bfs-bvfo-br-pl\node_modules\webpack\l...
mariamelior
1

votes
0

answer
331

Views

Webpack-Dev-Server throws WDS disconnected

the webpack dev server logs '[WDS] Disconnected!' every time the site has loaded. This confuses me because everything seems to work. The server runs in watch mode ('--watch-poll') and changes are applied immediately. For the future I would like to know if '[WDS] Disconnected!' can cause further erro...
Pascal
1

votes
0

answer
283

Views

run webpack-dev-server with '--hot' and occured an error as “configuration.entry should be one of these:”

My basic info like this: * Operating System: macos * Node Version: 8.7.0 * NPM Version: 6.0.1 * webpack Version: 4.8.3 * webpack-dev-server Version: 3.1.4 When i add '--hot' in the package.json > script > dev like this: { 'main': 'webpack.config.js', 'dependencies': {'babel-preset-react': '^6.24.1'}...
yy xia
1

votes
1

answer
291

Views

webpack-dev-server: How to open browser with Node.js API?

This is my script: const webpackDevServer = require('webpack-dev-server'); const webpack = require('webpack'); const config = require('./config'); const options = { contentBase: './dist', hot: true, hotOnly: true, open: true, host: 'localhost' }; webpackDevServer.addDevServerEntrypoints(config, opti...
李鸿章
1

votes
0

answer
229

Views

Webpack 4 Dev Server config with back end using virtual host

I'm working on a project split into 2 parts (on the same machine) : a front end using Webpack 4, a back end coded with PHP. I'm running Webpack Dev Server with the following config : ... devServer: { contentBase: '../backend/public', compress: true, proxy: { '/backend': { target: 'http://localhost:3...
Alexis Romot
1

votes
1

answer
78

Views

ngModel controller, $$updateEventHandler is undefined

i'm currently porting the development environment from gulp to webpack with out angularjs and react hybrid app. the application is huge. 10mb of files at the moment. but i am currently encountering some issues. this line: this.$$updateEventHandler = this.$$updateEventHandler.bind(this); which is ins...
1

votes
1

answer
178

Views

webpack-dev-server fails to run with error of validateSchema

this is a react hello-world proj , on local machine win7, use npm download packages, when run ' webpack-dev-server --open ' it has an error like these: F:\now\react\setup\node_modules\webpack-cli\bin\convert-argv.js:7 const validateSchema = process.webpackModule.validateSchema; TypeError: Cannot...
frontGirl
1

votes
1

answer
186

Views

I'm not able to use webpack-dev-server Unexpected token export at new Script (vm.js:74:7)

I get the following error when I run 'npm run start' or run 'node_modules/.bin/webpack-dev-server' from the command line: SyntaxError: Unexpected token export at new Script (vm.js:74:7) at createScript (vm.js:246:10) at Object.runInThisContext (vm.js:298:10) at Module._compile (internal/modules/cjs/...
user3196640
1

votes
0

answer
111

Views

Serving two entrypoints with webpack-server and Webpack4

We have two entrypoint (index and auth), that we want to be served using separate routes in development. We want the following routing when we run webpack-serve for development. / is routed to the index entry point. /auth is routed to the auth entry point. Our webpack.common.js looks like the follo...
TheJediCowboy

View additional questions