@s-ui/bundler 8.0.0-beta.17 → 8.0.0-beta.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "8.0.0-beta.17",
3
+ "version": "8.0.0-beta.18",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -15,9 +15,9 @@ const url = require('url')
15
15
 
16
16
  const {findFreePorts, isFreePort} = require('find-free-ports')
17
17
 
18
- const clearConsole = require('./clearConsole')
19
- const formatWebpackMessages = require('./formatWebpackMessages')
20
- const getProcessForPort = require('./getProcessForPort')
18
+ const clearConsole = require('./clearConsole.js')
19
+ const formatWebpackMessages = require('./formatWebpackMessages.js')
20
+ const getProcessForPort = require('./getProcessForPort.js')
21
21
 
22
22
  const {bold, cyan, green, yellow, red} = require('@s-ui/helpers/colors')
23
23
 
@@ -192,35 +192,6 @@ function createCompiler({
192
192
  return compiler
193
193
  }
194
194
 
195
- function resolveLoopback(proxy) {
196
- const o = url.parse(proxy)
197
- o.host = undefined
198
- if (o.hostname !== 'localhost') {
199
- return proxy
200
- }
201
- // Unfortunately, many languages (unlike node) do not yet support IPv6.
202
- // This means even though localhost resolves to ::1, the application
203
- // must fall back to IPv4 (on 127.0.0.1).
204
- // We can re-enable this in a few years.
205
- /* try {
206
- o.hostname = address.ipv6() ? '::1' : '127.0.0.1';
207
- } catch (_ignored) {
208
- o.hostname = '127.0.0.1';
209
- } */
210
-
211
- try {
212
- // Check if we're on a network; if we are, chances are we can resolve
213
- // localhost. Otherwise, we can just be safe and assume localhost is
214
- // IPv4 for maximum compatibility.
215
- if (!address.ip()) {
216
- o.hostname = '127.0.0.1'
217
- }
218
- } catch (_ignored) {
219
- o.hostname = '127.0.0.1'
220
- }
221
- return url.format(o)
222
- }
223
-
224
195
  // We need to provide a custom onError function for httpProxyMiddleware.
225
196
  // It allows us to log custom error messages on the console.
226
197
  function onProxyError(proxy) {
@@ -5,11 +5,18 @@ const webpack = require('webpack')
5
5
  const HtmlWebpackPlugin = require('html-webpack-plugin')
6
6
  const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
7
7
 
8
- const definePlugin = require('./shared/define')
9
- const manifestLoaderRules = require('./shared/module-rules-manifest-loader')
10
- const {aliasFromConfig, defaultAlias} = require('./shared/resolve-alias')
11
- const {envVars, MAIN_ENTRY_POINT, config, cleanList, when} = require('./shared')
12
- const {resolveLoader} = require('./shared/resolve-loader')
8
+ const {
9
+ envVars,
10
+ MAIN_ENTRY_POINT,
11
+ config,
12
+ cleanList,
13
+ when
14
+ } = require('./shared/index.js')
15
+ const definePlugin = require('./shared/define.js')
16
+ const manifestLoaderRules = require('./shared/module-rules-manifest-loader.js')
17
+ const {aliasFromConfig, defaultAlias} = require('./shared/resolve-alias.js')
18
+
19
+ const {resolveLoader} = require('./shared/resolve-loader.js')
13
20
 
14
21
  const EXCLUDED_FOLDERS_REGEXP = new RegExp(
15
22
  `node_modules(?!${path.sep}@s-ui(${path.sep}studio)(${path.sep}workbench)?${path.sep}src)`
@@ -41,7 +48,7 @@ const webpackConfig = {
41
48
  },
42
49
  stats: 'errors-only',
43
50
  entry: cleanList([
44
- require.resolve('react-dev-utils/webpackHotDevClient'),
51
+ require.resolve('./utils/webpackHotDevClient.js'),
45
52
  MAIN_ENTRY_POINT
46
53
  ]),
47
54
  target: 'web',