Skip to content

Commit 35286d8

Browse files
committed
Forgot to run the beautify script after changes
1 parent 0f4bc2d commit 35286d8

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

bin/webpack-dev-server.js

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ var wpOpt = require("webpack/bin/convert-argv")(yargs, argv, {
118118

119119
function processOptions(wpOpt) {
120120
//process Promise
121-
if (typeof wpOpt.then === "function") {
122-
wpOpt.then(processOptions).catch(function (err) {
121+
if(typeof wpOpt.then === "function") {
122+
wpOpt.then(processOptions).catch(function(err) {
123123
console.error(err.stack || err);
124124
process.exit(); // eslint-disable-line
125125
});
@@ -130,112 +130,112 @@ function processOptions(wpOpt) {
130130

131131
var options = wpOpt.devServer || firstWpOpt.devServer || {};
132132

133-
if (argv.host !== "localhost" || !options.host)
133+
if(argv.host !== "localhost" || !options.host)
134134
options.host = argv.host;
135135

136-
if (argv.public)
136+
if(argv.public)
137137
options.public = argv.public;
138138

139-
if (argv.port !== 8080 || !options.port)
139+
if(argv.port !== 8080 || !options.port)
140140
options.port = argv.port;
141141

142-
if (!options.publicPath) {
142+
if(!options.publicPath) {
143143
options.publicPath = firstWpOpt.output && firstWpOpt.output.publicPath || "";
144-
if (!/^(https?:)?\/\//.test(options.publicPath) && options.publicPath[0] !== "/")
144+
if(!/^(https?:)?\/\//.test(options.publicPath) && options.publicPath[0] !== "/")
145145
options.publicPath = "/" + options.publicPath;
146146
}
147147

148-
if (!options.outputPath)
148+
if(!options.outputPath)
149149
options.outputPath = "/";
150-
if (!options.filename)
150+
if(!options.filename)
151151
options.filename = firstWpOpt.output && firstWpOpt.output.filename;
152-
[].concat(wpOpt).forEach(function (wpOpt) {
152+
[].concat(wpOpt).forEach(function(wpOpt) {
153153
wpOpt.output.path = "/";
154154
});
155155

156-
if (!options.watchOptions)
156+
if(!options.watchOptions)
157157
options.watchOptions = firstWpOpt.watchOptions;
158158

159-
if (argv["stdin"]) {
160-
process.stdin.on('end', function () {
159+
if(argv["stdin"]) {
160+
process.stdin.on('end', function() {
161161
process.exit(0);
162162
});
163163
process.stdin.resume();
164164
}
165165

166-
if (!options.watchDelay && !options.watchOptions) // TODO remove in next major version
166+
if(!options.watchDelay && !options.watchOptions) // TODO remove in next major version
167167
options.watchDelay = firstWpOpt.watchDelay;
168168

169-
if (!options.hot)
169+
if(!options.hot)
170170
options.hot = argv["hot"];
171171

172-
if (argv["content-base"]) {
172+
if(argv["content-base"]) {
173173
options.contentBase = argv["content-base"];
174-
if (/^[0-9]$/.test(options.contentBase))
174+
if(/^[0-9]$/.test(options.contentBase))
175175
options.contentBase = +options.contentBase;
176-
else if (!/^(https?:)?\/\//.test(options.contentBase))
176+
else if(!/^(https?:)?\/\//.test(options.contentBase))
177177
options.contentBase = path.resolve(options.contentBase);
178-
} else if (argv["content-base-target"]) {
178+
} else if(argv["content-base-target"]) {
179179
options.contentBase = {
180180
target: argv["content-base-target"]
181181
};
182-
} else if (!options.contentBase) {
182+
} else if(!options.contentBase) {
183183
options.contentBase = process.cwd();
184184
}
185185

186-
if (!options.stats) {
186+
if(!options.stats) {
187187
options.stats = {
188188
cached: false,
189189
cachedAssets: false
190190
};
191191
}
192192

193-
if (typeof options.stats === "object" && typeof options.stats.colors === "undefined")
193+
if(typeof options.stats === "object" && typeof options.stats.colors === "undefined")
194194
options.stats.colors = require("supports-color");
195195

196-
if (argv["lazy"])
196+
if(argv["lazy"])
197197
options.lazy = true;
198198

199-
if (!argv["info"])
199+
if(!argv["info"])
200200
options.noInfo = true;
201201

202-
if (argv["quiet"])
202+
if(argv["quiet"])
203203
options.quiet = true;
204204

205-
if (argv["https"])
205+
if(argv["https"])
206206
options.https = true;
207207

208-
if (argv["cert"])
208+
if(argv["cert"])
209209
options.cert = fs.readFileSync(path.resolve(argv["cert"]));
210210

211-
if (argv["key"])
211+
if(argv["key"])
212212
options.key = fs.readFileSync(path.resolve(argv["key"]));
213213

214-
if (argv["cacert"])
214+
if(argv["cacert"])
215215
options.cacert = fs.readFileSync(path.resolve(argv["cacert"]));
216216

217-
if (argv["inline"] === false)
217+
if(argv["inline"] === false)
218218
options.inline = false;
219219

220-
if (argv["history-api-fallback"])
220+
if(argv["history-api-fallback"])
221221
options.historyApiFallback = true;
222222

223-
if (argv["compress"])
223+
if(argv["compress"])
224224
options.compress = true;
225225

226-
if (argv["open"])
226+
if(argv["open"])
227227
options.open = true;
228228

229229
var protocol = options.https ? "https" : "http";
230230

231-
if (options.inline !== false) {
231+
if(options.inline !== false) {
232232
var devClient = [require.resolve("../client/") + "?" + protocol + "://" + (options.public || (options.host + ":" + options.port))];
233233

234-
if (options.hot)
234+
if(options.hot)
235235
devClient.push("webpack/hot/dev-server");
236-
[].concat(wpOpt).forEach(function (wpOpt) {
237-
if (typeof wpOpt.entry === "object" && !Array.isArray(wpOpt.entry)) {
238-
Object.keys(wpOpt.entry).forEach(function (key) {
236+
[].concat(wpOpt).forEach(function(wpOpt) {
237+
if(typeof wpOpt.entry === "object" && !Array.isArray(wpOpt.entry)) {
238+
Object.keys(wpOpt.entry).forEach(function(key) {
239239
wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]);
240240
});
241241
} else {
@@ -244,26 +244,26 @@ function processOptions(wpOpt) {
244244
});
245245
}
246246

247-
new Server(webpack(wpOpt), options).listen(options.port, options.host, function (err) {
248-
if (err) throw err;
247+
new Server(webpack(wpOpt), options).listen(options.port, options.host, function(err) {
248+
if(err) throw err;
249249

250250
var uri = protocol + "://" + options.host + ":" + options.port + "/";
251-
if (options.inline === false)
251+
if(options.inline === false)
252252
uri += "webpack-dev-server/";
253253
console.log(uri);
254254

255255
console.log("webpack result is served from " + options.publicPath);
256-
if (Array.isArray(options.contentBase))
256+
if(Array.isArray(options.contentBase))
257257
console.log("content is served from " + options.contentBase.join(", "));
258-
else if (typeof options.contentBase === "object")
258+
else if(typeof options.contentBase === "object")
259259
console.log("requests are proxied to " + options.contentBase.target);
260260
else
261261
console.log("content is served from " + options.contentBase);
262-
if (options.historyApiFallback)
262+
if(options.historyApiFallback)
263263
console.log("404s will fallback to %s", options.historyApiFallback.index || "/index.html");
264-
if (options.open)
264+
if(options.open)
265265
open(uri);
266266
});
267267
}
268268

269-
processOptions(wpOpt);
269+
processOptions(wpOpt);

0 commit comments

Comments
 (0)