@s-ui/bundler 8.0.0-beta.28 → 8.0.0-beta.31

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 CHANGED
@@ -171,7 +171,6 @@ This tool works with zero configuration out the box but you could use some confi
171
171
  "alias": {
172
172
  "react": "preact"
173
173
  },
174
- "measure": true,
175
174
  "offline": true,
176
175
  "targets": {
177
176
  "chrome": "41",
@@ -213,10 +212,6 @@ You should pass a handler in order to handle when content gets cached for the fi
213
212
 
214
213
  If you want to remove your ServiceWorker, you need to use the method `unregister`, the same way you used the `register` method before.
215
214
 
216
- ### Build time measurement
217
-
218
- Set `measure` to `true` if you want to check step by step build times.
219
-
220
215
  ### Only Caching
221
216
 
222
217
  It's possible to create a service worker that caches all static resources
@@ -2,8 +2,8 @@
2
2
  /* eslint-disable no-console */
3
3
 
4
4
  const webpack = require('webpack')
5
- const log = require('../shared/log')
6
- const config = require('../webpack.config.prod')
5
+ const log = require('../shared/log.js')
6
+ const config = require('../webpack.config.prod.js')
7
7
  const {getSpawnPromise} = require('@s-ui/helpers/cli')
8
8
  const logUpdate = require('@s-ui/helpers/log-update')
9
9
 
@@ -18,8 +18,8 @@ const webpackConfig = require('../webpack.config.dev')
18
18
  const createDevServerConfig = require('../factories/createDevServerConfig')
19
19
  const createCompiler = require('../factories/createCompiler')
20
20
 
21
- const linkLoaderConfigBuilder = require('../loaders/linkLoaderConfigBuilder')
22
- const log = require('../shared/log')
21
+ const linkLoaderConfigBuilder = require('../loaders/linkLoaderConfigBuilder.js')
22
+ const log = require('../shared/log.js')
23
23
 
24
24
  const {CI = false, HOST = '0.0.0.0', HTTPS, PORT} = process.env
25
25
  const DEFAULT_PORT = +PORT || 3000
@@ -7,8 +7,8 @@ const webpack = require('webpack')
7
7
  const path = require('path')
8
8
  const {showError, showWarning} = require('@s-ui/helpers/cli')
9
9
  const {getPackageJson} = require('@s-ui/helpers/packages')
10
- const config = require('../webpack.config.lib')
11
- const log = require('../shared/log')
10
+ const config = require('../webpack.config.lib.js')
11
+ const log = require('../shared/log.js')
12
12
 
13
13
  program
14
14
  .usage('[options] <entry>')
@@ -12,6 +12,7 @@ const getWatchOptions = ({context, watch}) => {
12
12
  return {ignored: ignoredFiles(context)}
13
13
  }
14
14
 
15
+ /** @returns {import('webpack-dev-server').Configuration} */
15
16
  module.exports = config => ({
16
17
  allowedHosts: 'all',
17
18
  client: {
@@ -20,14 +21,20 @@ module.exports = config => ({
20
21
  errors: true,
21
22
  warnings: false
22
23
  },
23
- progress: true
24
+ progress: false
25
+ },
26
+ // Enable gzip compression of generated files
27
+ compress: true,
28
+ headers: {
29
+ 'Access-Control-Allow-Origin': '*',
30
+ 'Access-Control-Allow-Methods': '*',
31
+ 'Access-Control-Allow-Headers': '*'
24
32
  },
25
33
  static: {
26
34
  directory: 'public',
27
35
  watch: getWatchOptions(config)
28
36
  },
29
37
  hot: true,
30
- https: protocol === 'https',
31
38
  host,
32
39
  historyApiFallback: {
33
40
  disableDotRule: true
@@ -38,5 +45,6 @@ module.exports = config => ({
38
45
  middlewares.push(noopServiceWorkerMiddleware(config.output.publicPath))
39
46
 
40
47
  return middlewares
41
- }
48
+ },
49
+ server: protocol
42
50
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "8.0.0-beta.28",
3
+ "version": "8.0.0-beta.31",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -31,7 +31,7 @@
31
31
  "buffer": "6.0.3",
32
32
  "commander": "8.3.0",
33
33
  "css-loader": "6.5.1",
34
- "css-minimizer-webpack-plugin": "3.3.1",
34
+ "css-minimizer-webpack-plugin": "3.4.1",
35
35
  "esbuild": "0.14.11",
36
36
  "escape-string-regexp": "4.0.0",
37
37
  "fast-glob": "3.2.10",
@@ -42,8 +42,7 @@
42
42
  "postcss-loader": "6.2.1",
43
43
  "process": "0.11.10",
44
44
  "rimraf": "3.0.2",
45
- "sass": "1.48.0",
46
- "speed-measure-webpack-plugin": "1.5.0",
45
+ "sass": "1.49.0",
47
46
  "strip-ansi": "6.0.1",
48
47
  "style-loader": "3.3.1",
49
48
  "url": "0.11.0",
@@ -22,7 +22,7 @@
22
22
 
23
23
  const stripAnsi = require('strip-ansi')
24
24
  const url = require('url')
25
- const formatWebpackMessages = require('./formatWebpackMessages')
25
+ const formatWebpackMessages = require('./formatWebpackMessages.js')
26
26
 
27
27
  // We need to keep track of if there has been a runtime error.
28
28
  // Essentially, we cannot guarantee application state was not corrupted by the
@@ -3,7 +3,6 @@
3
3
  const path = require('path')
4
4
  const webpack = require('webpack')
5
5
  const HtmlWebpackPlugin = require('html-webpack-plugin')
6
- const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
7
6
 
8
7
  const {
9
8
  envVars,
@@ -27,8 +26,6 @@ const {CI = false} = process.env
27
26
 
28
27
  process.env.NODE_ENV = 'development'
29
28
 
30
- const smp = new SpeedMeasurePlugin()
31
-
32
29
  /** @typedef {import('webpack').Configuration} WebpackConfig */
33
30
 
34
31
  /** @type {WebpackConfig} */
@@ -132,4 +129,4 @@ const webpackConfig = {
132
129
  config.sourcemaps && config.sourcemaps.dev ? config.sourcemaps.dev : false
133
130
  }
134
131
 
135
- module.exports = config.measure ? smp.wrap(webpackConfig) : webpackConfig
132
+ module.exports = webpackConfig
@@ -8,7 +8,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
8
8
  const {WebpackManifestPlugin} = require('webpack-manifest-plugin')
9
9
  const MiniCssExtractPlugin = require('mini-css-extract-plugin')
10
10
  const InlineChunkHtmlPlugin = require('./shared/inline-chunk-html-plugin.js')
11
- const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
12
11
 
13
12
  const {
14
13
  when,
@@ -36,8 +35,6 @@ const cssFileName = config.onlyHash
36
35
  ? '[contenthash:8].css'
37
36
  : '[name].[contenthash:8].css'
38
37
 
39
- const smp = new SpeedMeasurePlugin()
40
-
41
38
  /** @typedef {import('webpack').Configuration} WebpackConfig */
42
39
 
43
40
  /** @type {WebpackConfig} */
@@ -137,4 +134,4 @@ const webpackConfig = {
137
134
  resolveLoader
138
135
  }
139
136
 
140
- module.exports = config.measure ? smp.wrap(webpackConfig) : webpackConfig
137
+ module.exports = webpackConfig