webpack-dev-server

Dev Mode for Node, Webpack-Dev-Server, React - No Such File or Directory for Nested Routes

馋奶兔 提交于 2019-12-11 07:29:39
问题 I am trying to get my application to work in development mode with Node and Webpack-Dev-Server. When I serve up '/' I get back exactly what I intend. However, when I do '/test' I get 'no such file or directory'. I have read a lot of documentation on Webpack's website and React Router Training, none seem to really answer this issue. I want to be able to use browserHistory instead of hashHistory (I am still using React-Router v3). package.json: { "name": "boilerplate", "version": "1.0.0",

Develop Angular2 Application with real server APIs

时光总嘲笑我的痴心妄想 提交于 2019-12-11 06:52:40
问题 I have a real server with REST APIs ready. Now I am developing an angular2 web application and want to consume real REST APIs in the development phase of the web application. I am using angular-cli. My server does not support cross origin access so I can not access the server REST api directly. I need some way to put a request/response handler for my webpack development server. It may be a silly question as I am trying nodejs world first time. 回答1: You should use 'cors' library to allow cross

TypeError: Cannot read property 'request' of undefined with angular-cli

[亡魂溺海] 提交于 2019-12-11 06:46:26
问题 I am using webpack in my angular 2 project. It is working fine with npm but after installing npm install -g angular-cli when I use `ng' command to create component or to build then it is showing below error. ERROR in TypeError: Cannot read property 'request' of undefined ExternalModuleFactoryPlugin.js:37 handleExternals [BackofficeVidapayCRM]/[webpack]/lib/ExternalModuleFactoryPlugin.js:37:33 ExternalModuleFactoryPlugin.js:46 next [BackofficeVidapayCRM]/[webpack]/lib

Make Webpack render in a file other than an index

妖精的绣舞 提交于 2019-12-11 06:35:19
问题 By default Webpack looks for a specific index.html file in a specified directory, right? What I want to know is can I tell webpack to look for and inject my bundled files in a file that I specify? I ask this because I'm trying to develop a Ghost theme with webpack and by default, a Ghost theme looks for a default.hbs file to serve as an index file. I tried to use the HtmlWebpackPlugin to set the filename for entry all while making the same file for web pack's output, but it's not working.

Issue getting webpack-dev-server to load

青春壹個敷衍的年華 提交于 2019-12-11 06:35:09
问题 I understand that the difference between building with webpack and webpack-dev-server is that the latter outputs and serves from memory and the former creates the output to disk and doesn't spin up Express to serve it. My issue is that my webpack config works fine if I run it through webpack, then run webpack-dev-server, but with the latter watching it, when changes are made, they're not reflected in the output (as expected since it's supposed to just impact what's in memory). However, if I

Error when loading jsx files with curly braces inside jsx

◇◆丶佛笑我妖孽 提交于 2019-12-11 04:23:49
问题 I am having following code in my .jsx file. var React = require('react'), ReactDOM = require('react-dom'); module.exports = React.createClass({ render: function() { var classes = {container: 'test'}; return (<div className={classes.container}></div>) } }); I am using following loader configuration in webpack-dev-server for jsx files loaders: [{ test: /\.jsx?$/, loaders: ['react-hot', 'babel?presets[]=es2015,presets[]=react'], exclude: /node_modules/ },{ test: /\.jsx?$/, loader: 'string

Webpack-dev-server and isomorphic react-node application

孤街浪徒 提交于 2019-12-11 04:17:51
问题 I've managed to properly use webpack dev server alongside with a node server (express), using the plugin section inside webpack's config. It all works fine but now I'm trying to go isomorphic and use client-side components inside the express application. So far the only problem I'm encountering is that without webpack 'parsing' my server-side code I get to a situation where I require components but the paths are not solved I.E. Inside a component 'use strict'; import React from 'react';

Cannot resolve module 'webpack/hot/emitter' while using hot reloader

一个人想着一个人 提交于 2019-12-11 01:58:27
问题 I am trying to implement react-hot-loader in my existing application. I followed the tutorial, and used the boilerplate file from this link as suggested in the tutorial. Then, when I start the node server using yarn start , I get the following error: ERROR in (webpack)-dev-server/client?http://0.0.0.0:3000 Module not found: Error: Cannot resolve module 'webpack/hot/emitter' in /Users/Rai/Documents/github/sarvahitey-core/client/node_modules/webpack-dev-server/client @ (webpack)-dev-server

react-share util.inherits is not a function webpack 2

て烟熏妆下的殇ゞ 提交于 2019-12-10 19:14:01
问题 i have the next error when i try to include react-share in my app, all compile fine and if i go to another routes where no is loading this library works fine, but when i include it crash. TypeError: util.inherits is not a function i am using webpack dev server with webpack 2. i am mocked the next modules note: i tried to mock utils so because util is not defined in not node env. node: { fs: "empty", child_process: "empty", }, 来源: https://stackoverflow.com/questions/43020296/react-share-util

React hot reload not working with webpack 4

断了今生、忘了曾经 提交于 2019-12-10 16:48:18
问题 React hot reload is not working. In webpack entry, I have following code. entry: { home: [ 'webpack-dev-server/client?http://0.0.0.0:8000', 'webpack/hot/dev-server', // add "only-dev-server" prevents reload on syntax errors path.join(__dirname, 'app/home-styles.js') ], main: [ 'babel-polyfill', path.join(__dirname, 'app/styles.js'), path.join(__dirname, 'app/vendor.js'), path.join(__dirname, 'app/index.js') ] }, and in dev-server I have hot = true; and i have below code for wrapping Provider