webpack-dev-server

react-router-dom BrowserRouter not navigating to paths with more than one url parameter

微笑、不失礼 提交于 2019-12-11 16:46:20
问题 I am having an issue where I am not able to navigate to Routes with paths greater than 1 section like so when using react-router-dom@4.2.2 : In addition, this is the Github link to the repo where I am having this issue. https://github.com/ShawnCholeva/React-Typescript-Webpack4-Router import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; //All routes work if I use HashRouter here instead of BrowserRouter class App extends Component

How to Configure WebpackDevServer to run an app with ASP.NET CORE 2.0 IISEXPRESS

倖福魔咒の 提交于 2019-12-11 15:38:37
问题 Using the ASP.NET Core 2.0 template for creating react app with redux i want to use the webpack-dev-server which is used in the react CRA (CREATE REACT APP) . The ASP.NET Core 2.0 app build outputs to a js (Client/Server) file and renders it on a razor page. (cshtml ) (SSR) which on run (F5) runs using the IISEXPRESS. I want to run the same using IISEXPRESS but using the WebpackDevServer since the execution in it faster especially after the initial build . I have tried the following by adding

Cannot load image using webpack dev server in nodejs

落爺英雄遲暮 提交于 2019-12-11 13:49:03
问题 Hi I am using the following code to try to draw a background for my game, but I keep getting the failure message and I couldn't figure out why this would happen. This is my main.js : this.background = new Image(); var context = document.getElementById('canvas').getContext('2d'); var loaded = false; var drawBackground = function () { loaded = true; var pattern = context.createPattern(this.background, 'repeat'); context.fillStyle = pattern; context.fillRect(0, 0, 10000, 10000); } this

How to access specific port in vagrant box laravel/homestead?

谁都会走 提交于 2019-12-11 13:24:48
问题 I'm working on a node project on my vagrant laravel/homestead box. Everything works fine, I can access the project when I go to the host define in my /etc/hosts : 192.168.10.10 project But, I'm trying to build and watch my project with webpack, so I installed webpack-dev-server and I can run it : http://localhost:8080/ webpack result is served from / content is served from /home/vagrant/Workspace/Kanban 404s will fallback to /index.html [...] webpack: bundle is now VALID. My problem is, when

Babel trying to load LESS style with webpack

二次信任 提交于 2019-12-11 12:22:51
问题 I'm not sure as to why I am getting this SyntaxError . It looks as if there is an error with my loaders not being able to load the LESS but my extract-text-webpack-plugin or ExtractTextPlugin is able to build it and I end up with a style.css at the webpack output. It seems like babel is trying to process my LESS but I'm not sure where it is trying to do so. Error: /Users/bli1/Development/Javascript/ReviewWeb/node_modules/babel-core/lib/transformation/file/index.js:671 [1] throw err; [1] ^ [1]

How to separate index.html and assets in webpack-dev-server?

房东的猫 提交于 2019-12-11 11:26:57
问题 i want to have the following build folder structure: /build/index.html /build/static/bundlename.js /build/static/bundlename.css /build/static/img/* /build/static/fonts/* How can i achieve this? I have figured out this by addition /static prefix to bundlename itself for webpack normal build itself. But when i run this config in webpack-dev-server it doesn't server files by /static/ path. I use file-loader and url-loader for fonts, how i can change their path as well? THey appear in /build root

Webpack out of memory

强颜欢笑 提交于 2019-12-11 11:19:32
问题 When I'm working with a webpack-dev server, the problem sometimes occurs FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory more here Config webpack.config.js "webpack": "^4.5.0", "webpack-cli": "^2.0.14", "webpack-dev-server": "^3.1.3", NodeJS version: node -v v9.3.0 OS version: macOS High Sierra 10.13.6 Has anyone encountered a similar problem? 回答1: You might get away with the following. The issue is caused by a memory leak in postcss-loader. The one liner

How to start a server before protractor runs and clean up afterwards

蹲街弑〆低调 提交于 2019-12-11 08:42:49
问题 It seems protractor doesn't provide any out of the box solution for starting a server before it runs. Having to run multiple commands before functional tests will run is a bad user experience and bad for automated testing. Angular-cli has its own solution that is rather complicated, which this plugin claims to duplicate, although it doesn't work for me and may be unmaintained. https://www.npmjs.com/package/protractor-webpack EDIT: BETTER SOLUTION ACCEPTED BELOW I came up with a solution using

Foundation 6 + webpack : Cannot make Foundation JS work

≯℡__Kan透↙ 提交于 2019-12-11 08:14:14
问题 I'm struggling to install foudation js 6 with webpack. I have an "Unexpected token import". I think it's should be related to babel but I can't find wher's the problem. I use foundation-sites 6.4.1 Here's my webpack.config.js var webpack = require('webpack') var ExtractTextPlugin = require('extract-text-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin') var express = require('express') var path = require('path') module.exports = { module: { loaders: [ { test: /\.json$/,

React Production Build shows 404 on page refresh

≯℡__Kan透↙ 提交于 2019-12-11 07:46:35
问题 I have a ReactJS application which works very well on development environment. I am using webpack. When I run yarn build and I drop my files on my server, everything runs fine. but if I click refresh on the browser, I get a 404. My server uses Apache. I have tried htaccess, I have done historyFallBackApi. None of them seem to solve my problem Here is my .htaccess RewriteBase / RewriteCond %{REQUEST_URI} !^/(assets/?|$) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d