@best-shot/dev-server 0.13.2 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/middleware/not-found/404.html +1 -76
- package/middleware/static-file/index.mjs +1 -1
- package/middleware/static-file/style.css +89 -0
- package/middleware/wait-page/index.mjs +1 -1
- package/middleware/wait-page/template.ejs +46 -0
- package/package.json +13 -11
- package/middleware/wait-page/template.html +0 -112
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ DevServer support of `@best-shot/cli`.
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
17
|
- All Features of [webpack-dev-server@4](https://webpack.js.org/configuration/dev-server/)
|
|
18
|
-
- Hook `historyApiFallback` into `
|
|
18
|
+
- Hook `historyApiFallback` into `publicPath`
|
|
19
19
|
- Show a wait page when bundling
|
|
20
|
-
- Provide a 404 page
|
|
20
|
+
- Provide a 404 error page
|
|
21
21
|
- Open source file in vscode (from vue-devtools)
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
@@ -10,87 +10,12 @@
|
|
|
10
10
|
/>
|
|
11
11
|
<title>Page not found</title>
|
|
12
12
|
<link href="/.best-shot/logo.png" rel="shortcut icon" type="image/png" />
|
|
13
|
+
<link href="/.best-shot/style.css" rel="stylesheet" />
|
|
13
14
|
<style>
|
|
14
15
|
html {
|
|
15
|
-
min-width: 300px;
|
|
16
|
-
height: 100%;
|
|
17
|
-
min-height: 300px;
|
|
18
16
|
-webkit-user-select: none;
|
|
19
17
|
-moz-user-select: none;
|
|
20
18
|
-ms-user-select: none;
|
|
21
|
-
user-select: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
img {
|
|
25
|
-
pointer-events: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
body {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
margin: 0;
|
|
34
|
-
background-color: white;
|
|
35
|
-
height: 100%;
|
|
36
|
-
color: #999999;
|
|
37
|
-
font-family: -apple-system, BlinkMacSystemFont, roboto, 'Segoe UI',
|
|
38
|
-
Segoe, Helvetica, Arial, monospace;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.logo {
|
|
42
|
-
margin-right: 4%;
|
|
43
|
-
width: 44px;
|
|
44
|
-
width: 8vw;
|
|
45
|
-
width: clamp(32px, 8vw, 54px);
|
|
46
|
-
height: 44px;
|
|
47
|
-
height: 8vw;
|
|
48
|
-
height: clamp(32px, 8vw, 54px);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.not-found {
|
|
52
|
-
margin-bottom: 20vh;
|
|
53
|
-
width: 60%;
|
|
54
|
-
max-width: 400px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
header {
|
|
58
|
-
margin-bottom: 20vh;
|
|
59
|
-
text-align: right;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
h1 {
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
margin: 0;
|
|
67
|
-
width: 100%;
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
font-size: 44px;
|
|
70
|
-
font-size: 8vw;
|
|
71
|
-
font-size: clamp(32px, 8vw, 60px);
|
|
72
|
-
line-height: 1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
p {
|
|
76
|
-
margin-top: 0.5em;
|
|
77
|
-
margin-bottom: 0;
|
|
78
|
-
white-space: nowrap;
|
|
79
|
-
font-size: 18px;
|
|
80
|
-
font-size: 4vw;
|
|
81
|
-
font-size: clamp(14px, 4vw, 22px);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
a {
|
|
85
|
-
color: #9933ff;
|
|
86
|
-
text-decoration: none;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@media (prefers-color-scheme: dark) {
|
|
91
|
-
body {
|
|
92
|
-
background-color: #222222;
|
|
93
|
-
}
|
|
94
19
|
}
|
|
95
20
|
</style>
|
|
96
21
|
</head>
|
|
@@ -9,7 +9,7 @@ export function staticFile() {
|
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
|
|
11
11
|
router.get(
|
|
12
|
-
'/.best-shot/:name(404.svg|logo.svg|logo.png)',
|
|
12
|
+
'/.best-shot/:name(404.svg|logo.svg|logo.png|style.css)',
|
|
13
13
|
({ params: { name } }, res) => {
|
|
14
14
|
res.sendFile(name, { root: __dirname });
|
|
15
15
|
},
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
html {
|
|
2
|
+
background-color: white;
|
|
3
|
+
min-width: 300px;
|
|
4
|
+
user-select: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@media (prefers-color-scheme: dark) {
|
|
8
|
+
html {
|
|
9
|
+
background-color: #222222;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
img {
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
color: #888888;
|
|
22
|
+
font-family: -apple-system, BlinkMacSystemFont, roboto, 'Segoe UI', Segoe,
|
|
23
|
+
Helvetica, Arial, monospace;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.logo {
|
|
27
|
+
margin-right: 8px;
|
|
28
|
+
width: calc(32px + 1vw);
|
|
29
|
+
height: calc(32px + 1vw);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
header {
|
|
33
|
+
padding-top: 10vh;
|
|
34
|
+
text-align: right;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
h1 {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
margin-top: 0;
|
|
42
|
+
margin-bottom: 20px;
|
|
43
|
+
width: 100%;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
font-size: calc(32px + 1vw);
|
|
46
|
+
line-height: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
p {
|
|
50
|
+
margin-top: 0;
|
|
51
|
+
margin-bottom: 0.5em;
|
|
52
|
+
font-size: calc(18px + 0.25vw);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.not-found {
|
|
56
|
+
margin-top: 150px;
|
|
57
|
+
margin-bottom: 150px;
|
|
58
|
+
width: 60%;
|
|
59
|
+
max-width: 400px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a {
|
|
63
|
+
color: #9933ff;
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
progress {
|
|
69
|
+
margin-top: 10px;
|
|
70
|
+
border: none;
|
|
71
|
+
border-radius: 12px;
|
|
72
|
+
width: 60%;
|
|
73
|
+
height: 24px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
progress::-webkit-progress-bar {
|
|
77
|
+
border-radius: 12px;
|
|
78
|
+
background-color: #eeeeee;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
progress::-webkit-progress-value {
|
|
82
|
+
border-radius: 12px;
|
|
83
|
+
background-color: #9933ff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
progress::-moz-progress-bar {
|
|
87
|
+
border-radius: 12px;
|
|
88
|
+
background-color: #9933ff;
|
|
89
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
|
|
6
|
+
<meta content="webkit" name="renderer" />
|
|
7
|
+
<meta
|
|
8
|
+
content="width=device-width,initial-scale=1,user-scalable=no,shrink-to-fit=no,viewport-fit=cover"
|
|
9
|
+
name="viewport"
|
|
10
|
+
/>
|
|
11
|
+
<meta content="1" http-equiv="refresh" />
|
|
12
|
+
<title>Bundling...</title>
|
|
13
|
+
<link href="/.best-shot/logo.png" rel="shortcut icon" type="image/png" />
|
|
14
|
+
<link href="/.best-shot/style.css" rel="stylesheet" />
|
|
15
|
+
<style>
|
|
16
|
+
html {
|
|
17
|
+
-webkit-user-select: none;
|
|
18
|
+
-moz-user-select: none;
|
|
19
|
+
-ms-user-select: none;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<header>
|
|
25
|
+
<h1>
|
|
26
|
+
<img alt="logo" class="logo" src="/.best-shot/logo.svg" />
|
|
27
|
+
BEST SHOT
|
|
28
|
+
</h1>
|
|
29
|
+
<p>Bundling...</p>
|
|
30
|
+
</header>
|
|
31
|
+
<br />
|
|
32
|
+
<br />
|
|
33
|
+
<br />
|
|
34
|
+
<br />
|
|
35
|
+
<% for (var i = 0 ; i < progress.length ; i++) { var percent =
|
|
36
|
+
Math.round(100 * progress[i][0]); %> <%= percent %> %
|
|
37
|
+
<progress max="100" value="<%= percent %>"></progress>
|
|
38
|
+
<br />
|
|
39
|
+
<p class="message"><%= progress[i][1] || '' %></p>
|
|
40
|
+
<p class="modules"><%= progress[i][2] || '' %></p>
|
|
41
|
+
<p class="active"><%= progress[i][3] || '' %></p>
|
|
42
|
+
<% for (var m = 4 ; m < progress[i].length; m++) { %>
|
|
43
|
+
<p class="last"><%= progress[i][m] || '' %></p>
|
|
44
|
+
<% } %> <% } %>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@best-shot/dev-server",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"description": "DevServer support of `@best-shot/cli`",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -31,21 +31,23 @@
|
|
|
31
31
|
},
|
|
32
32
|
"main": "index.mjs",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@best-shot/config": "^0.2.
|
|
35
|
-
"chalk": "^
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"lodash": "^4.17.21",
|
|
41
|
-
"webpack-dev-server": "^4.7.3",
|
|
34
|
+
"@best-shot/config": "^0.2.13",
|
|
35
|
+
"chalk": "^5.0.1",
|
|
36
|
+
"ejs": "^3.1.8",
|
|
37
|
+
"express": "^4.18.1",
|
|
38
|
+
"launch-editor-middleware": "^2.5.0",
|
|
39
|
+
"webpack-dev-server": "^4.10.0",
|
|
42
40
|
"webpack-dev-server-waitpage": "^2.1.1"
|
|
43
41
|
},
|
|
44
42
|
"peerDependencies": {
|
|
45
|
-
"@best-shot/cli": "^0.12.
|
|
43
|
+
"@best-shot/cli": "^0.12.6"
|
|
46
44
|
},
|
|
47
45
|
"engines": {
|
|
48
|
-
"node": "^14.17.0 ||
|
|
46
|
+
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public",
|
|
50
|
+
"registry": "https://registry.npmjs.org/"
|
|
49
51
|
},
|
|
50
52
|
"x-readme": {
|
|
51
53
|
"logo": "https://cdn.jsdelivr.net/gh/best-shot/best-shot/packages/core/logo.svg"
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
|
|
6
|
-
<meta content="webkit" name="renderer" />
|
|
7
|
-
<meta
|
|
8
|
-
content="width=device-width,initial-scale=1,user-scalable=no,shrink-to-fit=no,viewport-fit=cover"
|
|
9
|
-
name="viewport"
|
|
10
|
-
/>
|
|
11
|
-
<meta content="1" http-equiv="refresh" />
|
|
12
|
-
<title>Bundling...</title>
|
|
13
|
-
<link href="/.best-shot/logo.png" rel="shortcut icon" type="image/png" />
|
|
14
|
-
<style>
|
|
15
|
-
html {
|
|
16
|
-
min-width: 300px;
|
|
17
|
-
height: 100%;
|
|
18
|
-
min-height: 300px;
|
|
19
|
-
-webkit-user-select: none;
|
|
20
|
-
-moz-user-select: none;
|
|
21
|
-
-ms-user-select: none;
|
|
22
|
-
user-select: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
img {
|
|
26
|
-
pointer-events: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
body {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: center;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
margin: 0;
|
|
35
|
-
background-color: white;
|
|
36
|
-
height: 100%;
|
|
37
|
-
color: #999999;
|
|
38
|
-
font-family: -apple-system, BlinkMacSystemFont, roboto, 'Segoe UI',
|
|
39
|
-
Segoe, Helvetica, Arial, monospace;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.logo {
|
|
43
|
-
margin-right: 4%;
|
|
44
|
-
width: 44px;
|
|
45
|
-
width: 8vw;
|
|
46
|
-
width: clamp(32px, 8vw, 54px);
|
|
47
|
-
height: 44px;
|
|
48
|
-
height: 8vw;
|
|
49
|
-
height: clamp(32px, 8vw, 54px);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
header {
|
|
53
|
-
margin-bottom: 20vh;
|
|
54
|
-
text-align: right;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
h1 {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
margin: 0;
|
|
62
|
-
width: 100%;
|
|
63
|
-
white-space: nowrap;
|
|
64
|
-
font-size: 44px;
|
|
65
|
-
font-size: 8vw;
|
|
66
|
-
font-size: clamp(32px, 8vw, 60px);
|
|
67
|
-
line-height: 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
p {
|
|
71
|
-
margin-top: 0.5em;
|
|
72
|
-
margin-bottom: 0;
|
|
73
|
-
white-space: nowrap;
|
|
74
|
-
font-size: 18px;
|
|
75
|
-
font-size: 4vw;
|
|
76
|
-
font-size: clamp(14px, 4vw, 22px);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
progress {
|
|
80
|
-
margin-top: 10px;
|
|
81
|
-
width: 60%;
|
|
82
|
-
height: 24px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@media (prefers-color-scheme: dark) {
|
|
86
|
-
body {
|
|
87
|
-
background-color: #222222;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
91
|
-
</head>
|
|
92
|
-
<body>
|
|
93
|
-
<header>
|
|
94
|
-
<h1>
|
|
95
|
-
<img alt="logo" class="logo" src="/.best-shot/logo.svg" />
|
|
96
|
-
BEST SHOT
|
|
97
|
-
</h1>
|
|
98
|
-
<p>Bundling...</p>
|
|
99
|
-
</header>
|
|
100
|
-
|
|
101
|
-
<% for (var i = 0 ; i < progress.length ; i++) { var percent =
|
|
102
|
-
Math.round(100 * progress[i][0]); %> <%= percent %> %
|
|
103
|
-
<progress max="100" value="<%= percent %>"></progress>
|
|
104
|
-
|
|
105
|
-
<p class="message"><%= progress[i][1] || '' %></p>
|
|
106
|
-
<p class="modules"><%= progress[i][2] || '' %></p>
|
|
107
|
-
<p class="active"><%= progress[i][3] || '' %></p>
|
|
108
|
-
<% for (var m = 4 ; m < progress[i].length; m++) { %>
|
|
109
|
-
<p class="last"><%= progress[i][m] || '' %></p>
|
|
110
|
-
<% } %> <% } %>
|
|
111
|
-
</body>
|
|
112
|
-
</html>
|