Skip to content

Commit

Permalink
chore: support webpack-dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
FredZeng authored and xqq committed Jun 30, 2022
1 parent f19ccdb commit e18eee5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"build": "webpack --mode=production --progress",
"build:debug": "webpack --mode=development --progress",
"watch": "webpack --mode=development --progress --watch"
"watch": "webpack --mode=development --progress --watch",
"serve": "webpack serve --mode=development --progress"
},
"dependencies": {
"es6-promise": "^4.2.5",
Expand All @@ -29,6 +30,7 @@
"@types/node": "^10.12.18",
"@typescript-eslint/eslint-plugin": "^1.4.2",
"@typescript-eslint/parser": "^1.4.2",
"@webpack-cli/serve": "^1.7.0",
"browser-sync": "^2.26.10",
"eslint": "^5.15.0",
"exports-loader": "^0.7.0",
Expand All @@ -39,7 +41,8 @@
"ts-loader": "^5.3.2",
"typescript": "^3.2.2",
"webpack": "^4.28.3",
"webpack-cli": "^3.3.12",
"webpack-cli": "^4.4.0",
"webpack-dev-server": "^4.9.3",
"ws": ">=7.4.6",
"xmlhttprequest-ssl": ">=1.6.2"
},
Expand Down
10 changes: 10 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,15 @@ module.exports = {
use: 'source-map-loader'
}
]
},

devServer: {
static: ['demo'],
proxy: {
'/dist': {
target: 'http://localhost:8080',
pathRewrite: {'^/dist' : ''}
}
}
}
};

0 comments on commit e18eee5

Please sign in to comment.