webpack-dev-server

How to start React project with HTTPS

ⅰ亾dé卋堺 提交于 2020-08-10 19:11:45
问题 I'm trying to start my React project with HTTPS instead of HTTP. I have my project in an Ubuntu Server and I want to try it with HTTPS. I have created a SSL certificate with Certbot for my domain and I want to use it in React. I have tried to modify the file Server.js in node_module/webpack-dev-server/lib/Server.js as follows: // Certificate const privateKey = fs.readFileSync('/etc/letsencrypt/live/adan.appha.es/privkey1.pem', 'utf8'); const certificate = fs.readFileSync('/etc/letsencrypt

Nginx - setting up SSL with existing .crt, .key and CA.pem files

陌路散爱 提交于 2020-07-10 12:25:25
问题 I have a .crt , .key and CA.pem files that were generated like this. These certs are kind of project-wide, and they work when firing up a webpack-dev-server server on HTTPS like: devServer: { https: { key: fs.readFileSync('/path/to/example.com.key'), cert: fs.readFileSync('/path/to/examle.com.crt'), ca: fs.readFileSync('/path/to/CA.pem'), } } Now I need to setup an Nginx server using these 3 files, but I've been trying with no luck. Here's my config: server { listen 3000; ssl_certificate

Nginx - setting up SSL with existing .crt, .key and CA.pem files

瘦欲@ 提交于 2020-07-10 12:23:26
问题 I have a .crt , .key and CA.pem files that were generated like this. These certs are kind of project-wide, and they work when firing up a webpack-dev-server server on HTTPS like: devServer: { https: { key: fs.readFileSync('/path/to/example.com.key'), cert: fs.readFileSync('/path/to/examle.com.crt'), ca: fs.readFileSync('/path/to/CA.pem'), } } Now I need to setup an Nginx server using these 3 files, but I've been trying with no luck. Here's my config: server { listen 3000; ssl_certificate

Nginx - setting up SSL with existing .crt, .key and CA.pem files

放肆的年华 提交于 2020-07-10 12:20:03
问题 I have a .crt , .key and CA.pem files that were generated like this. These certs are kind of project-wide, and they work when firing up a webpack-dev-server server on HTTPS like: devServer: { https: { key: fs.readFileSync('/path/to/example.com.key'), cert: fs.readFileSync('/path/to/examle.com.crt'), ca: fs.readFileSync('/path/to/CA.pem'), } } Now I need to setup an Nginx server using these 3 files, but I've been trying with no luck. Here's my config: server { listen 3000; ssl_certificate

Nginx - setting up SSL with existing .crt, .key and CA.pem files

守給你的承諾、 提交于 2020-07-10 12:19:37
问题 I have a .crt , .key and CA.pem files that were generated like this. These certs are kind of project-wide, and they work when firing up a webpack-dev-server server on HTTPS like: devServer: { https: { key: fs.readFileSync('/path/to/example.com.key'), cert: fs.readFileSync('/path/to/examle.com.crt'), ca: fs.readFileSync('/path/to/CA.pem'), } } Now I need to setup an Nginx server using these 3 files, but I've been trying with no luck. Here's my config: server { listen 3000; ssl_certificate

Webpack-Dev-Server: Errors while compiling. Reload prevented. (Stack: React)

微笑、不失礼 提交于 2020-07-10 08:39:41
问题 I use React with Webpack-Dev-Server for local Development. Every now and then I get this error: "react_devtools_backend.js:6 [WDS] Errors while compiling. Reload prevented." After the error occurs, no code-change is being updated on the browser. package.json: "devDependencies": { "@babel/core": "^7.9.6", "@babel/plugin-transform-runtime": "^7.9.6", "@babel/preset-env": "^7.9.6", "@babel/preset-react": "^7.9.4", "@material-ui/core": "^4.10.0", "babel-loader": "^8.1.0", "css-loader": "^3.5.3",

Why is webpack unable to find react when I'm using a custom entry point?

烈酒焚心 提交于 2020-06-27 16:46:28
问题 I set up a custom entry point in Webpack but am getting an error on this line of my React code: import React from 'react'; Webpack is able to build it, but itsnt intercepting that path because Chrome gives me this console error: Uncaught TypeError: Failed to resolve module specifier "react". Relative references must start with either "/", "./", or "../" However, when I change the path as suggested to: import React from './react'; Then webpack is unable to build and gives this error: ERROR in

webpack-dev-server compiles but does not refresh my web browser

瘦欲@ 提交于 2020-06-27 16:28:48
问题 I am trying to "hot-load" my jsx components by using webpack-dev-server. This is the command I am using: bin/webpack-dev-server --host 0.0.0.0 When I save my jsx code, it interestingly compiles, but does not inform my development web server that the update took place. I have to manually refresh the browser for the change to be reflected. I am using docker, so I suspect that it has something to do with a network issue. I notice that webpack-dev-server uses port 3035 and my web development

webpack-dev-server compiles but does not refresh my web browser

自作多情 提交于 2020-06-27 16:27:03
问题 I am trying to "hot-load" my jsx components by using webpack-dev-server. This is the command I am using: bin/webpack-dev-server --host 0.0.0.0 When I save my jsx code, it interestingly compiles, but does not inform my development web server that the update took place. I have to manually refresh the browser for the change to be reflected. I am using docker, so I suspect that it has something to do with a network issue. I notice that webpack-dev-server uses port 3035 and my web development

webpack-dev-server: how to get error line numbers of orignal files

醉酒当歌 提交于 2020-06-25 09:19:08
问题 With webpack-dev-server running it seems that all errors in the output are pointing to line numbers in the bundle.js and not the original source file. How do I get line numbers of the original source files? I'm using webpack with babel for ES2015 js. webpack.config.dev.js const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { devtool: '#source-map', entry: [ `webpack-dev-server/client?http://${process.env