@s-ui/bundler 8.0.0-beta.29 → 8.0.0-beta.32
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 +0 -5
- package/bin/sui-bundler-analyzer.js +2 -2
- package/bin/sui-bundler-dev.js +2 -2
- package/bin/sui-bundler-lib.js +2 -2
- package/factories/createDevServerConfig.js +11 -3
- package/package.json +1 -2
- package/utils/webpackHotDevClient.js +1 -1
- package/webpack.config.dev.js +1 -4
- package/webpack.config.prod.js +5 -5
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
|
|
package/bin/sui-bundler-dev.js
CHANGED
|
@@ -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
|
package/bin/sui-bundler-lib.js
CHANGED
|
@@ -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:
|
|
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.
|
|
3
|
+
"version": "8.0.0-beta.32",
|
|
4
4
|
"description": "Config-free bundler for ES6 React apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sui-bundler": "./bin/sui-bundler.js"
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"process": "0.11.10",
|
|
44
44
|
"rimraf": "3.0.2",
|
|
45
45
|
"sass": "1.49.0",
|
|
46
|
-
"speed-measure-webpack-plugin": "1.5.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
|
package/webpack.config.dev.js
CHANGED
|
@@ -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 =
|
|
132
|
+
module.exports = webpackConfig
|
package/webpack.config.prod.js
CHANGED
|
@@ -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} */
|
|
@@ -68,7 +65,10 @@ const webpackConfig = {
|
|
|
68
65
|
minimizer: [minifyJs({extractComments, sourceMap}), minifyCss()].filter(
|
|
69
66
|
Boolean
|
|
70
67
|
),
|
|
71
|
-
runtimeChunk: true
|
|
68
|
+
runtimeChunk: true,
|
|
69
|
+
splitChunks: {
|
|
70
|
+
chunks: 'all'
|
|
71
|
+
}
|
|
72
72
|
},
|
|
73
73
|
plugins: cleanList([
|
|
74
74
|
new webpack.ProvidePlugin({
|
|
@@ -137,4 +137,4 @@ const webpackConfig = {
|
|
|
137
137
|
resolveLoader
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
module.exports =
|
|
140
|
+
module.exports = webpackConfig
|