Skip to content

Commit aeaa6aa

Browse files
chore: update to latest webpack
1 parent d751a45 commit aeaa6aa

File tree

4 files changed

+1726
-2856
lines changed

4 files changed

+1726
-2856
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'CI'
1+
name: "CI"
22

33
on:
44
push:
@@ -7,7 +7,6 @@ on:
77
pull_request:
88

99
jobs:
10-
1110
ci:
1211
needs: [test]
1312
runs-on: ubuntu-latest
@@ -19,12 +18,11 @@ jobs:
1918
runs-on: ubuntu-latest
2019
strategy:
2120
matrix:
22-
yarncmd: ['test']
21+
yarncmd: ["test"]
2322
steps:
2423
- uses: actions/checkout@v2
2524
- name: Configure
2625
run: |
27-
npm config set scripts-prepend-node-path auto
2826
git config --global user.email [email protected]
2927
git config --global user.name uirouter_github_actions
3028
- name: Install Dependencies

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Architecture overview demo for UI-Router React",
55
"scripts": {
66
"clean": "rimraf docs",
7-
"start": "NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 3000 --config webpack.config.js --history-api-fallback --content-base ./",
7+
"start": "NODE_ENV=development webpack serve --config webpack.config.js",
88
"build": "npm run clean && mkdirp docs && cp index.html docs/index.html && NODE_ENV=production webpack",
99
"test": "npm run build && cypress-runner run --path docs",
1010
"test:open": "npm run build && cypress-runner open --path docs",
@@ -15,7 +15,9 @@
1515
"dependencies": {
1616
"@uirouter/react": "^1.0.7",
1717
"@uirouter/visualizer": "^7.2.1",
18+
"browserslist": "4.28.1",
1819
"lodash": "^4.17.21",
20+
"picomatch": "4.0.3",
1921
"react": "^16.14.0",
2022
"react-dom": "^16.14.0",
2123
"whatwg-fetch": "^3.6.2"
@@ -25,18 +27,17 @@
2527
"@babel/preset-env": "^7.14.9",
2628
"@babel/preset-react": "^7.14.5",
2729
"@uirouter/cypress-runner": "^1.1.0",
28-
"autoprefixer": "^9.8.6",
29-
"babel-loader": "^8.2.2",
30+
"autoprefixer": "^10.4.23",
31+
"babel-loader": "^10.0.0",
3032
"babel-plugin-transform-class-properties": "^6.24.1",
31-
"copy-webpack-plugin": "^5.1.1",
32-
"css-loader": "^3.6.0",
33-
"file-loader": "^6.2.0",
34-
"postcss-load-config": "^2.1.2",
35-
"postcss-loader": "^3.0.0",
36-
"rimraf": "^3.0.2",
37-
"style-loader": "^1.3.0",
38-
"webpack": "^4.46.0",
39-
"webpack-cli": "^3.3.12",
40-
"webpack-dev-server": "^3.11.2"
33+
"copy-webpack-plugin": "^13.0.1",
34+
"css-loader": "^7.1.2",
35+
"postcss-load-config": "^6.0.1",
36+
"postcss-loader": "^8.2.0",
37+
"rimraf": "^6.1.2",
38+
"style-loader": "^4.0.0",
39+
"webpack": "^5.104.1",
40+
"webpack-cli": "^6.0.1",
41+
"webpack-dev-server": "^5.2.2"
4142
}
4243
}

webpack.config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ module.exports = {
1616
filename: 'bundle.js',
1717
publicPath: ''
1818
},
19+
devServer: {
20+
host: '0.0.0.0',
21+
port: 3000,
22+
static: {
23+
directory: path.join(__dirname),
24+
},
25+
historyApiFallback: true,
26+
},
1927
module: {
2028
rules: [
2129
{
@@ -26,15 +34,15 @@ module.exports = {
2634
},
2735
{
2836
test: /\.css$/,
29-
loader: 'style-loader!css-loader!postcss-loader'
37+
use: ['style-loader', 'css-loader', 'postcss-loader']
3038
},
3139
{
3240
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
33-
loader: 'file-loader',
41+
type: 'asset/resource',
3442
}
3543
]
3644
},
3745
plugins: [
38-
new CopyWebpackPlugin([ { from: 'static', to: 'static' } ]),
39-
]
46+
new CopyWebpackPlugin({ patterns: [{ from: 'static', to: 'static' }] }),
47+
],
4048
};

0 commit comments

Comments
 (0)