-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: imports #3299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: imports #3299
Conversation
@@ -980,6 +985,9 @@ class Server { | |||
} | |||
|
|||
serveMagicHtml(req, res, next) { | |||
const getFilenameFromUrl = | |||
require('webpack-dev-middleware/dist/utils/getFilenameFromUrl').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add this method to public webpack-dev-middleware
API here https://github.com/webpack/webpack-dev-middleware/blob/master/src/index.js#L78, in future we should avoid import non public API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will do 👍🏻
Codecov Report
@@ Coverage Diff @@
## master #3299 +/- ##
==========================================
+ Coverage 95.40% 95.56% +0.16%
==========================================
Files 34 34
Lines 1241 1241
Branches 354 354
==========================================
+ Hits 1184 1186 +2
Misses 51 51
+ Partials 6 4 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
const fs = require('graceful-fs'); | ||
const ipaddr = require('ipaddr.js'); | ||
const internalIp = require('internal-ip'); | ||
const killable = require('killable'); | ||
const chokidar = require('chokidar'); | ||
const express = require('express'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in future we reduce them more, good right now
const https = require('https'); | ||
const http = require('http'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it'd make a difference, but I think we can move these below just like require('spdy')
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to send PR
For Bugs and Features; did you add new tests?
No, Already present.
Motivation / Use-Case
Reduce import at startup.
Breaking Changes
None
Additional Info
No