webpack-dev-server

Why does angular2-webpack-starter work with:' localhost:3000/#/', but Not with 'https://hostname/front/#/' WHY?

一曲冷凌霜 提交于 2020-01-05 06:20:24
问题 I am using the 'angular2-webpack-stater' project and am ready to integrate with with my back end server. I setup nginx with two proxy-passes to connect to the front-end and the back-end: server { listen [::]:443 ssl; listen 443 ssl; server_name xxxxxxxxx.com; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; root /var/www; index index.php index.html index.htm; autoindex off; rewrite_log on; location ^~ /server/ { proxy_set_header X-Real-IP $remote_addr; proxy_set

Unhandled Rejection (ChunkLoadError): Loading chunk 1 failed

时光毁灭记忆、已成空白 提交于 2020-01-05 03:46:24
问题 I am basically trying to do a poc on extracting the some part of my main application into a separate package.A Sample separate package I have built it in my git repo myapp-poc-ui. Now I am trying to access this in my main application. package.json : "dependencies": { "myapp-poc-ui": "git+https://github.com/prabhatmishra33/myapp-poc-ui#master", "react": "^16.10.1", "react-dom": "^16.10.1", "react-scripts": "3.2.0" }, I am accessing the exported module in my main app by: import React from

Webpack2, how to exclude react and react dom from build

对着背影说爱祢 提交于 2020-01-04 23:43:09
问题 My goal is to create a module for a react components library made in ES6 using webpack. I am using: webpack: "2.1.0-beta.25" react: "15.4.1" I need to assign react and react-dom as peerDependencies so it doesn't get downloaded by the developer. This is the relevant part of my package.json : "peerDependencies": { "react": "15.4.1" }, "dependencies": { "chalk": "1.1.3", "compression": "1.6.2", "cross-env": "3.1.3", "immutable": "3.8.1", "invariant": "2.2.1", "lodash": "4.16.4", "minimist": "1.2

Not safe typescript compilation when webpack-dev-server npm package is installed

江枫思渺然 提交于 2020-01-04 06:14:48
问题 I have a very small project written in typescript and it is currently compiled with Babel. I want to get rid of Babel and leave just a typescript compiler to produce the result JS. Also, I want to have JS working on mobile and old desktop browsers, so I leave a default target setting - 'ECMA Script 3'. To demonstrate my issue, it's enough to complie a script with one line of code: let clone = Object.assign({}, {a:1}); Initially, compiler successfully catches the issue and shows an error: test

Webpack bundle all css and load first

﹥>﹥吖頭↗ 提交于 2020-01-04 05:28:36
问题 How to bundle all the css file together and load on the top of the head before the document loads using webpack ? 回答1: From my understanding, using a dummy .js file in order just to build a global/shared css bundle which imports needed css files may be a solution. I don't know if this is a best practice but works for me. An alternative approach may bu using Webpack together with Gulp, but it means an extra step will be required in every build. So in webpack.config.js I have an entry such as:

How to use webpack-dev-server with multiple webpack configs?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 09:04:19
问题 Imagine I have a project like this: /moduleA/src... /moduleB/src... /mainApp/src... I have a separate webpack.config for each module and the main app. The modules are libraries and the main app imports those libraries. Is it possible to configure webpack-dev-server to serve all three? What I want to avoid is having to stop the dev server, rebuild moduleA and moduleB, and restart the dev server, every time I want to make a change to moduleA or B. 回答1: Not with webpack-dev-server only because

How to use webpack-dev-server with multiple webpack configs?

百般思念 提交于 2020-01-03 09:04:10
问题 Imagine I have a project like this: /moduleA/src... /moduleB/src... /mainApp/src... I have a separate webpack.config for each module and the main app. The modules are libraries and the main app imports those libraries. Is it possible to configure webpack-dev-server to serve all three? What I want to avoid is having to stop the dev server, rebuild moduleA and moduleB, and restart the dev server, every time I want to make a change to moduleA or B. 回答1: Not with webpack-dev-server only because

WebPack-Dev-Server error: require is not defined

我是研究僧i 提交于 2020-01-03 08:33:08
问题 Webpack itself is working fine, but the webpack-dev-server is not. Basically, webpack created 2 build files for me, a back-end bundle and a front-end bundle. So, I have a webpack-config.js for each of these. I want to develop my front-end code with webpack-dev-server, as you can see from my webpack-config file for my front-end-bundle.js below. When I run web-pack-dev server, it is able to find and build my front-end.js and index.html, but nothing renders in the console and it gives me a

WebPack-Dev-Server error: require is not defined

╄→гoц情女王★ 提交于 2020-01-03 08:33:08
问题 Webpack itself is working fine, but the webpack-dev-server is not. Basically, webpack created 2 build files for me, a back-end bundle and a front-end bundle. So, I have a webpack-config.js for each of these. I want to develop my front-end code with webpack-dev-server, as you can see from my webpack-config file for my front-end-bundle.js below. When I run web-pack-dev server, it is able to find and build my front-end.js and index.html, but nothing renders in the console and it gives me a

React Hot loader 3 with webpack-dev

£可爱£侵袭症+ 提交于 2020-01-03 03:11:36
问题 I'm trying to use hot-react-loader in my project. So I changed some files to work with this but I get an error when I edit a component. Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). [HMR] Cannot apply update. Need to do a full reload! what am I doing wrong? webpack.config.dev.js var webpack = require('webpack'); var path = require('path'); // Questo il plugin di webpack