webpack-dev-server

How do I get webpack-dev-server to accept POST requests

我与影子孤独终老i 提交于 2020-01-02 07:51:29
问题 In my project I call: $ webpack-dev-server --history-api-fallback And it starts an express server (I'm assuming) available on localhost:8080 . It works great except that I want to submit a form via POST into an iframe loading my app; localhost:8080 in development and something else in production. I don't expect to do anything with that POST data in development, but in production, it needs to be POST. When I try to use POST however, it cannot find POST / Is there a configuration option or some

“.builders['browser']” should have required property 'class'

流过昼夜 提交于 2020-01-02 06:38:29
问题 After installing the dependencies successfully using npm install, I got the following error while running the server: Schema validation failed with the following errors: Data path ".builders['browser']" should have required property 'class'. After searching for a while, I think the problem is with "@angular-builders/custom-webpack" . The project was working good, but i accidentally deleted it and clone it again, then i got the error. Here's the dev dependencies: "devDependencies": { "@angular

前端工程自动化构建总结

大憨熊 提交于 2020-01-02 05:37:12
前端自动化构建是当下的热门,我记得2014年的时候,前端的自动化构建,大多是用在javascript的合并、压缩、语法检查、coffeescript,Sass,LESS转换上,构建工具也有很多,比如ant,grunt,gulp等,二次封装的工具也有很多,比如百度的FIS,国外的Yeoman。2016年以后,随着es6,es7,Node的兴起,前端又发生了翻天覆的变化,特别是移动端的H5最为明显,以前切个图,在PC上预览测试就可以发布的时代,在移动端就不灵验了,在手机端预览至少要搭建一个http服务器,比如http://192.168.0.2/index.html。在手机端输入网址不方全,通常会将网址做成一个二维码,然后用手机扫一下就可以打开预览。我们每改一下样式,就在手机上点一下刷新或电脑上按一下F5,这在最初的时候,也不觉得有什么问题,因为拿到我手上的静态页,通常由切片的同事做好了兼容性测试,需要一边刷新浏览器,一边改样式的机会不多。随着我们尝试用Less,stylus,这样的css工具,一方面,需要用到gulp这样的工具在后台自动监听我们的样式改动,另一方面,手动刷新的时候,gulp的脚本未必转换完了。这时候迫切需要浏览器自动刷新。 总的来说,需求就两点,一是需要一个http服务器,来供手机访问静态资源,另一个是监听代码的改动并自动刷新浏览器。要满足这两个需求的第三方工具

WebPack sourcemaps confusing (duplicated files)

风格不统一 提交于 2020-01-01 08:05:14
问题 I decided to try out WebPack on a new project I'm spinning up today and I'm getting really strange behavior from the sourcemaps. I can't find anything about it in the documentation, nor can I find anyone else having this issue when skimming StackOverflow. I'm currently looking at the HelloWorld app produced by Vue-CLI's WebPack template -- no changes have been made to the code, the build environment, or anything. I installed everything and ran it like so: vue init webpack test && cd test &&

how to have use own jade file for webpack?

和自甴很熟 提交于 2020-01-01 05:52:51
问题 I'm new to webpack and trying to figure out how to use my own html file in the webpack-dev-server, as well as my webpack build. in my app.js I have: require('!jade!index.jade') but that does not make an index.html as I would expect. Instead, it seems at best I can get a string output of my html, which isn't what I want: var jade = require('!jade!index.jade') jade() //outputs my html How do I get it to output an index.html file? How do I get the webpack-dev-server to use that html file? I

how to have use own jade file for webpack?

☆樱花仙子☆ 提交于 2020-01-01 05:52:12
问题 I'm new to webpack and trying to figure out how to use my own html file in the webpack-dev-server, as well as my webpack build. in my app.js I have: require('!jade!index.jade') but that does not make an index.html as I would expect. Instead, it seems at best I can get a string output of my html, which isn't what I want: var jade = require('!jade!index.jade') jade() //outputs my html How do I get it to output an index.html file? How do I get the webpack-dev-server to use that html file? I

Getting webpack hot updating to work correctly in my isomorphic web app

可紊 提交于 2020-01-01 05:25:07
问题 I'm creating a webapp with a node/express backend and a react frontend. I got (I think) most of it up and running, but the last step of getting the browser to perform a hot refresh does not work as intended. I'll try to post all the relevant setup here. Please let me know if you require anything else to find out where I have done a mistake: I start up my application with node ./server/index.js webpack.config.js var path = require('path'); var webpack = require('webpack'); let webpackConfig =

vuecli2.0完成多页面应用中遇到的问题

我是研究僧i 提交于 2020-01-01 01:11:52
1. @ECHO off SETLOCAL CALL :find_dp0 IF EXIST "%dp0%\node.exe" ( SET "_prog=%dp0%\node.exe" "--max_old_space_size=4096" ) ELSE ( SET "_prog=node" "--max_old_space_size=4096" SET PATHEXT=%PATHEXT:;.JS;=;% ) "%_prog%" "%dp0%\..\webpack-dev-server\bin\webpack-dev-server.js" %* ENDLOCAL EXIT /b %errorlevel% :find_dp0 SET dp0=%~dp0 EXIT /b webpack 内存溢出 Allocation failed - JavaScript heap out of memory 项目中,当组件文件过多,webpack-dev-server 编译时,容易内存溢出,在 \node_modules\.bin\webpack-dev-server.cmd 加以下红色配置,暂可解决 这个问题的产生原因说明:刚开始的项目完成过程中并没有出现这些问题,但是随着前端页面的增加,逻辑的处理复杂以后,导致了node的环境内存不够用,继而引起了上述的问题,修改底层的代码以后,就解决了这个问题

How to use VS Code debugger with webpack-dev-server (breakpoints ignored)

寵の児 提交于 2019-12-31 08:30:07
问题 My problem is simple. I just want to make VS Code's debugger work with webpack-dev-server without ignoring my breakpoints. Now, webpack-dev-server serves the bundled files from memory, while, if I understand this correctly, the VS Code debugger searches for them on disk (...or not?...) As a result, whenever I set a breakpoint I get the dreaded Breakpoint ignored because generated code not found (source map problem?) Now, every related question I could find had to do with typescript mostly,

Webpack configuration file found but no entry configured

浪尽此生 提交于 2019-12-31 05:36:06
问题 Im trying to organize a webpack 2 template for my personal projects with webpack-dev-server and run it with the npm commands, but i'm getting this error: Configuration file found but no entry configured. It's weird because the entry is defined and i tested the resolved route, it's fine, so here is my webpack config, the command to run it and the file to configure the loaders: webpack.config.dev.js const path = require('path'); const fs = require('fs'); const configs = require('./dev-wpk-conf'