Webpack

How to make proxy work on Angular 2 with webpack-dev-server configuration?

牧云@^-^@ 提交于 2021-01-07 04:13:14
问题 I have an app in Angular 2 (2.4.1) and a server with the following: Front-end runs on localhost:8081 and has: node v6.17.1 npm v3.10.10 Among devDependencies in package.json: "devDependencies": { ..., "typescript": "2.1.1", "webpack": "1.13.3", "webpack-dev-server": "1.16.2", ... } "scripts": { "webpack": "webpack", "server": "npm run server:dev", "serverprod": "npm run server:prod", "server:dev": "webpack-dev-server -d --config config/webpack.develop.js --inline --progress --profile --colors

How to make proxy work on Angular 2 with webpack-dev-server configuration?

左心房为你撑大大i 提交于 2021-01-07 04:11:58
问题 I have an app in Angular 2 (2.4.1) and a server with the following: Front-end runs on localhost:8081 and has: node v6.17.1 npm v3.10.10 Among devDependencies in package.json: "devDependencies": { ..., "typescript": "2.1.1", "webpack": "1.13.3", "webpack-dev-server": "1.16.2", ... } "scripts": { "webpack": "webpack", "server": "npm run server:dev", "serverprod": "npm run server:prod", "server:dev": "webpack-dev-server -d --config config/webpack.develop.js --inline --progress --profile --colors

How to make proxy work on Angular 2 with webpack-dev-server configuration?

家住魔仙堡 提交于 2021-01-07 04:11:39
问题 I have an app in Angular 2 (2.4.1) and a server with the following: Front-end runs on localhost:8081 and has: node v6.17.1 npm v3.10.10 Among devDependencies in package.json: "devDependencies": { ..., "typescript": "2.1.1", "webpack": "1.13.3", "webpack-dev-server": "1.16.2", ... } "scripts": { "webpack": "webpack", "server": "npm run server:dev", "serverprod": "npm run server:prod", "server:dev": "webpack-dev-server -d --config config/webpack.develop.js --inline --progress --profile --colors

How do I access a *dependent* UMD library from within a web browser?

你离开我真会死。 提交于 2021-01-07 02:47:51
问题 I'm trying to separate out two large optional pieces of a library so the user doesn't have to load them unless they're needed. Trying to sort out the interdependencies with webpack, however, is driving me crazy. Getting the main part of the library working hasn't been a problem, but making the optional pieces work is going nowhere fast. Here's just one of many webpack configurations that I've tried: const umdConfig = env => { return { mode: env?.dev ? 'development' : 'production', target:

How to use webpack 4 JSON tree-shaking feature with keys containing the character “-”?

ぐ巨炮叔叔 提交于 2021-01-07 02:36:10
问题 I would like to use webpack 4's JSON tree-shaking feature but I am hitting a roadblock. This is some working code: import { accessibility_16 } from '@collab-ui/icons/data/iconsData.json'; console.log("accessibility_16:", accessibility_16); iconsData.json is a HUGE file, but thanks to webpack I only get the code related to accessibility_16 in the final bundle (when using webpack -p ). The issue is that some keys in the JSON file are not valid JavaScript identifiers, example: arrow-circle-down

How to use webpack 4 JSON tree-shaking feature with keys containing the character “-”?

陌路散爱 提交于 2021-01-07 02:34:24
问题 I would like to use webpack 4's JSON tree-shaking feature but I am hitting a roadblock. This is some working code: import { accessibility_16 } from '@collab-ui/icons/data/iconsData.json'; console.log("accessibility_16:", accessibility_16); iconsData.json is a HUGE file, but thanks to webpack I only get the code related to accessibility_16 in the final bundle (when using webpack -p ). The issue is that some keys in the JSON file are not valid JavaScript identifiers, example: arrow-circle-down

configure npm&webpack Win10 for long paths using relative paths

[亡魂溺海] 提交于 2021-01-07 02:16:31
问题 Current webpack bundling project folder structure (win10) : root_folder\ |--node_modules |--src |--index.js |--template.html |--package.json |--webpack.config.js Contents of index.js : console.log("Hello webpack"); Contents of template.html : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title><%= htmlWebpackPlugin.options.title %></title> </head> <body> <div id="root"></div> </body> </html> Contents of package.json: { "name": "test", "version": "1.0.0", "description": "",

configure npm&webpack Win10 for long paths using relative paths

风格不统一 提交于 2021-01-07 02:16:30
问题 Current webpack bundling project folder structure (win10) : root_folder\ |--node_modules |--src |--index.js |--template.html |--package.json |--webpack.config.js Contents of index.js : console.log("Hello webpack"); Contents of template.html : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title><%= htmlWebpackPlugin.options.title %></title> </head> <body> <div id="root"></div> </body> </html> Contents of package.json: { "name": "test", "version": "1.0.0", "description": "",

使用Vue+JFinal框架搭建前后端分离系统

余生长醉 提交于 2021-01-06 04:19:35
前后端分离作为Web开发的一种方式,现在应用越来越广泛。前端一般比较流行Vue.js框架,后端框架比较多,网上有很多Vue+SpringMVC前后端分离的demo,但是Vue+JFinal框架貌似没有搜到,本文基于Vue.js和JFinal框架,给出了搭建了一个前后端分离项目的简单例子。 第一步:maven搭建后端JFinal部分 1、用maven新建web项目,项目名vue-jfinal 2、添加JFinal框架和jetty容器等依赖 < dependency > < groupId > javax.servlet </ groupId > < artifactId > javax.servlet-api </ artifactId > < version > 4.0.1 </ version > < scope > provided </ scope > </ dependency > < dependency > < groupId > com.jfinal </ groupId > < artifactId > jfinal </ artifactId > < version > 3.3 </ version > </ dependency > < dependency > < groupId > com.jfinal </ groupId > < artifactId >

Module parse failed: Unexpected character '@' (1:0) with Storybook 6.1.11, Webpack 5.11.0, React 17.0.1

丶灬走出姿态 提交于 2021-01-06 03:40:58
问题 Trying to setup a react-app with all latest versions. Github Repo Link Trying to run storybook with sass file imported will result in below error. Trying to run without importing the styles, storybook works. The same code works correctly when its run as npm start run with no warnings and errors. I have configured css modules using @dr.pogodin/babel-plugin-react-css-modules with sass, webpack 5, react 17 and with latest packages. ERROR in ./src/assets/stylesheets/app.scss 1:0 Module parse