Skip to content

Commit 8e629d1

Browse files
authored
Merge branch 'master' into fix-typo-error
2 parents 72578de + b0ad9d8 commit 8e629d1

File tree

9 files changed

+161
-44
lines changed

9 files changed

+161
-44
lines changed

lib/utils/normalizeOptions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
const path = require('path');
34
const isAbsoluteUrl = require('is-absolute-url');
45
const getCompilerConfigArray = require('./getCompilerConfigArray');
56

@@ -14,7 +15,7 @@ function normalizeOptions(compiler, options) {
1415
: {};
1516

1617
const defaultOptionsForStatic = {
17-
directory: process.cwd(),
18+
directory: path.join(process.cwd(), 'static'),
1819
staticOptions: {},
1920
publicPath: ['/'],
2021
serveIndex: { icons: true },

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"eslint-config-prettier": "^6.15.0",
8484
"eslint-config-webpack": "^1.2.5",
8585
"eslint-plugin-import": "^2.22.1",
86-
"execa": "^4.1.0",
86+
"execa": "^5.0.0",
8787
"file-loader": "^6.2.0",
8888
"html-webpack-plugin": "^4.5.0",
8989
"husky": "^4.3.0",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Heyo.

test/server/host-option.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
'use strict';
22

3+
const path = require('path');
34
const request = require('supertest');
45
const config = require('../fixtures/simple-config/webpack.config');
56
const testServer = require('../helpers/test-server');
67
const port = require('../ports-map')['host-option'];
78

9+
const staticDirectory = path.resolve(
10+
__dirname,
11+
'../fixtures/contentbase-config'
12+
);
13+
814
describe('host option', () => {
915
let server = null;
1016
let req = null;
@@ -15,6 +21,7 @@ describe('host option', () => {
1521
config,
1622
{
1723
static: {
24+
directory: staticDirectory,
1825
watch: false,
1926
},
2027
port,
@@ -44,6 +51,7 @@ describe('host option', () => {
4451
config,
4552
{
4653
static: {
54+
directory: staticDirectory,
4755
watch: false,
4856
},
4957
// eslint-disable-next-line no-undefined
@@ -75,6 +83,7 @@ describe('host option', () => {
7583
config,
7684
{
7785
static: {
86+
directory: staticDirectory,
7887
watch: false,
7988
},
8089
host: null,
@@ -105,6 +114,7 @@ describe('host option', () => {
105114
config,
106115
{
107116
static: {
117+
directory: staticDirectory,
108118
watch: false,
109119
},
110120
host: '127.0.0.1',
@@ -135,6 +145,7 @@ describe('host option', () => {
135145
config,
136146
{
137147
static: {
148+
directory: staticDirectory,
138149
watch: false,
139150
},
140151
host: 'localhost',
@@ -165,6 +176,7 @@ describe('host option', () => {
165176
config,
166177
{
167178
static: {
179+
directory: staticDirectory,
168180
watch: false,
169181
},
170182
host: '0.0.0.0',

0 commit comments

Comments
 (0)