webpack-dev-server

springboot + webpack dev server, does not change localhost bundle file after rebuilding

断了今生、忘了曾经 提交于 2019-12-12 18:27:14
问题 click this pic and please read below 1.this first pic is after run webpack-dev-sercer --hot --inline second pic is my html : the way i call js file i changed my jsx file to test server and npm said complete rebuild but, bundled js file in localhost:9090 does not change after rebuilding like upper pic below code is my webpack.config.js file var path = require('path'); var webpack = require('webpack'); var merge = require('webpack-merge'); var HtmlWebpackPlugin = require('html-webpack-plugin');

Webpack-dev-server in sub directory - not compiling & no hot reloading

大城市里の小女人 提交于 2019-12-12 17:21:46
问题 I'm trying to run webpack dev server in a sub directory (public), so that I can integrate react into an existing site. Repo - minimal-react-webpack-starter When I run it from a sub directory, using npm run start , neither hot reloading or compilation work, but when I run them from root without --content-base or devServer.publicPath it works fine. Folder structure - |- App/ |- node-modules/ |- public/ |- react/ |- main.js |- index.html |- shared/ |- react/ |- components/ |- main.js |- package

When shouldn't you accept webpack Hot Module Reloading?

江枫思渺然 提交于 2019-12-12 12:06:43
问题 So with webpack, HMR will only work if you have this code in your module or a parent of your module: if (module.hot) { module.hot.accept() } Which makes me wonder why you would ever decline HMR in the first place. Is there a performance cost or other negative side effect to using it? The docs aren't very clear on the issue. 回答1: You can only use HMR if your code is either stateless (like CSS) or provides preparations to clean up the old state Since most code is not stateless, there is some

Webpack dev server hot mode not working

我怕爱的太早我们不能终老 提交于 2019-12-12 10:50:34
问题 Heres my config: devServer: { contentBase: '/web/dist/', hot: true, stats: {colors: true}, inline: true } And here's the gulp task im running: gulp.task('build', ['clean', 'styles', 'bower', 'media', 'data', 'homepage'], function(done) { es6promise.polyfill(); console.log('STARTING DEV SERVER...'); server = new WebpackDevServer(webpack(webpackDevConfig), webpackDevConfig.devServer); server.listen(8080, '0.0.0.0', function (err, stats) { if (err) { throw new gutil.PluginError("webpack-dev

Angular 5 unable to get XSRF token from HttpXsrfTokenExtractor

北战南征 提交于 2019-12-12 07:36:19
问题 I am trying to make a POST request via an absolute URL to a Spring (Basic authentication) secured Rest API. Having read that Angular omits inserting the X-XSRF-TOKEN into the request header automatically for absolute urls, I tried to implement an HttpInterceptor to add the token in. In my original /signin POST request, I create the necessary authorization: Basic header to ensure Spring authenticates the request. The response header returned contains the expected set-cookie token: Set-Cookie

webpack-dev-server to return auto-generated for specific URL?

社会主义新天地 提交于 2019-12-12 05:13:52
问题 I have a single page app which connects to a back-end REST API on a different server. On index.html app load, first thing it does is GET /env.json which contains the URL for the REST API server. Obviously, it is different in prod than in test than in dev. Is there any way I can add middleware to the webpack-dev-server so that when it sees GET /env.json it serves up automatically generated json (based on env var or other)? If there is an easier way, I am open to it. My assumption was that dev

How can I change my API BaseUrl in Aurelia for development?

送分小仙女□ 提交于 2019-12-12 05:04:24
问题 I have the following in my app.ts constructor( container: Container ) { let client: HttpClient = new HttpClient; client.configure( config => { config.useStandardConfiguration() .withBaseUrl( 'http://localhost:8080/' ) .withDefaults( { credentials: 'include', headers: { Accept: 'application/json' } } ); } ); container.registerSingleton( HttpClient, () => client ); } the problem is http://localhost:8080 is only correct for local development, it should be / the rest of the time. This is because

issue with webpack-server 2

浪子不回头ぞ 提交于 2019-12-12 01:52:24
问题 When i run webpack server, it redirects me to folders of project not my index.html, but if I open it without webpack server it works fine, and nothing in network tab. I think my webpack.config.js not loaded correctely! my webpack.confing.js : const ExtractTextPlugin = require("extract-text-webpack-plugin"); var path = require("path"); module.exports = { entry : './src/app.js', output : { path : path.resolve(__dirname,'dist'), filename : 'app.bundle.js' }, module : { rules : [ {test: /\.scss$/

Why can't webpack find any module from my React Webapp?

不打扰是莪最后的温柔 提交于 2019-12-11 21:16:18
问题 I want to run webpack on ubuntu to run my react webapp. When running webpack from the command line, I get the following error (just a small extraction of all the errors that I get): ERROR in Cannot find module 'loader-utils' @ ./src/components/WaitingMsg.styl 4:14-129 13:2-17:4 14:20-135 ERROR in Cannot find module 'loader-utils' @ ./src/components/CreateBox.styl 4:14-128 13:2-17:4 14:20-134 ERROR in Cannot find module 'loader-utils' @ ./src/components/Trashbin.styl 4:14-127 13:2-17:4 14:20

Webpack There are multiple modules with names that only differ in casing

*爱你&永不变心* 提交于 2019-12-11 17:49:50
问题 I have something like this: WARNING in C:/Data/.../letsTest.jsx There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these module identifiers: * C:\Data\...\node_modules\babel-loader\lib\index.js?presets[]=es2015&presets[]=react&presets[]=stage-0&presets[]=stage-2!C:\Data\...\letsTest.jsx Used by 4 module(s), i. e. multi C:/Data/Doc/13/13080801/LetsTest/letsTest