Skip to content

Commit 70ce564

Browse files
authored
Merge branch 'master' into chore/update
2 parents 9e6f5f9 + ad6619b commit 70ce564

File tree

8 files changed

+96
-85
lines changed

8 files changed

+96
-85
lines changed

.github/workflows/nodejs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,25 @@ jobs:
7878
if: matrix.os == 'windows-latest'
7979
run: npm i -g npm
8080

81+
- name: Get npm cache directory
82+
id: npm-cache-dir
83+
run: |
84+
echo "::set-output name=dir::$(npm config get cache)"
85+
8186
- name: Cache Node.js modules
8287
id: cache
8388
uses: actions/cache@v2
8489
with:
85-
# npm cache files are stored in `~/.npm` on Linux/macOS
86-
path: ~/.npm
87-
key: ${{ runner.OS }}-${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ hashFiles('**/package-lock.json') }}
90+
path: ${{ steps.npm-cache-dir.outputs.dir }}
91+
key: ${{ runner.os }}-${{ matrix.webpack-version }}-node-${{ hashFiles('**/package-lock.json') }}
8892
restore-keys: |
89-
${{ runner.OS }}-${{ matrix.node-version }}-${{ matrix.webpack-version }}-
90-
${{ runner.OS }}-
93+
${{ runner.os }}-${{ matrix.webpack-version }}-node-
9194
9295
- name: Install dependencies
93-
if: steps.cache.outputs.cache-hit != 'true'
9496
run: npm ci
9597

9698
- name: Install webpack ${{ matrix.webpack-version }}
99+
if: matrix.webpack-version == '4'
97100
run: npm i webpack@${{ matrix.webpack-version }}
98101

99102
- name: Link webpack-dev-server

bin/cli-flags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
{
6969
name: 'stdin',
7070
type: Boolean,
71-
description: 'close when stdin ends',
71+
description: 'Close when stdin ends',
7272
},
7373
{
7474
name: 'open',

lib/utils/normalizeOptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function normalizeOptions(compiler, options) {
1515
: {};
1616

1717
const defaultOptionsForStatic = {
18-
directory: path.join(process.cwd(), 'static'),
18+
directory: path.join(process.cwd(), 'public'),
1919
staticOptions: {},
2020
publicPath: ['/'],
2121
serveIndex: { icons: true },

package-lock.json

Lines changed: 77 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
"ws": "^7.4.3"
6767
},
6868
"devDependencies": {
69-
"@babel/cli": "^7.12.13",
70-
"@babel/core": "^7.12.13",
69+
"@babel/cli": "^7.12.16",
70+
"@babel/core": "^7.12.16",
7171
"@babel/plugin-transform-runtime": "^7.12.15",
72-
"@babel/preset-env": "^7.12.13",
72+
"@babel/preset-env": "^7.12.16",
7373
"@babel/runtime": "^7.12.13",
7474
"@commitlint/cli": "^11.0.0",
7575
"@commitlint/config-conventional": "^11.0.0",
@@ -92,7 +92,7 @@
9292
"less": "^3.12.2",
9393
"less-loader": "^7.1.0",
9494
"lint-staged": "^10.5.4",
95-
"marked": "^1.2.9",
95+
"marked": "^2.0.0",
9696
"memfs": "^3.2.0",
9797
"npm-run-all": "^4.1.5",
9898
"prettier": "^2.2.1",

test/cli/__snapshots__/cli.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`CLI --hot webpack 5 1`] = `
44
"<i> [webpack-dev-server] Project is running at http://localhost:8080/
5-
<i> [webpack-dev-server] Content not from webpack x.x.x served from 'Xdir/static' directory
5+
<i> [webpack-dev-server] Content not from webpack x.x.x served from 'Xdir/public' directory
66
<i> [webpack-dev-middleware] asset main.js X KiB [emitted] (name: main)
77
<i> runtime modules X KiB 10 modules
88
<i> cacheable modules X KiB
@@ -21,7 +21,7 @@ exports[`CLI --hot webpack 5 1`] = `
2121
2222
exports[`CLI --no-hot webpack 5 1`] = `
2323
"<i> [webpack-dev-server] Project is running at http://localhost:8080/
24-
<i> [webpack-dev-server] Content not from webpack x.x.x served from 'Xdir/static' directory
24+
<i> [webpack-dev-server] Content not from webpack x.x.x served from 'Xdir/public' directory
2525
<i> [webpack-dev-middleware] asset main.js X KiB [emitted] (name: main)
2626
<i> runtime modules X bytes 3 modules
2727
<i> cacheable modules X KiB

test/cli/cli.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runCLITest('CLI', () => {
3737
.replace(/webpack [^ )]+/g, 'webpack x.x.x')
3838
.replace(new RegExp(quotemeta(basePath.replace(/\\/g, '/')), 'g'), 'Xdir')
3939
.replace(new RegExp(quotemeta(basePath), 'g'), 'Xdir')
40-
.replace(/[\\/]static/, '/static')
40+
.replace(/[\\/]public/, '/public')
4141
.replace(/(Hash:) [a-z0-9]+/g, '$1 X')
4242
.replace(/ dependencies:Xms/g, '')
4343
.replace(/, additional resolving: X ms/g, '');

test/server/utils/normalizeOptions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ describe('normalizeOptions', () => {
449449

450450
if (data.options.static) {
451451
data.options.static.forEach((staticOpts) => {
452-
if (staticOpts.directory === path.join(process.cwd(), 'static')) {
452+
if (staticOpts.directory === path.join(process.cwd(), 'public')) {
453453
// give an indication in the snapshot that this is the
454454
// current working directory
455455
staticOpts.directory = 'CWD';

0 commit comments

Comments
 (0)