@s-ui/bundler 8.0.0-beta.22 → 8.0.0-beta.27
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const webpack = require('webpack')
|
|
2
|
-
const formatWebpackMessages = require('../utils/formatWebpackMessages')
|
|
3
|
-
const clearConsole = require('../utils/clearConsole')
|
|
4
|
-
const log = require('../shared/log')
|
|
2
|
+
const formatWebpackMessages = require('../utils/formatWebpackMessages.js')
|
|
3
|
+
const clearConsole = require('../utils/clearConsole.js')
|
|
4
|
+
const log = require('../shared/log.js')
|
|
5
5
|
|
|
6
6
|
const isInteractive = process.stdout.isTTY
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ const printInstructions = ({urls}) =>
|
|
|
14
14
|
module.exports = (config, urls) => {
|
|
15
15
|
let compiler
|
|
16
16
|
try {
|
|
17
|
-
compiler = webpack(config)
|
|
17
|
+
compiler = webpack(config, () => {})
|
|
18
18
|
} catch (err) {
|
|
19
19
|
log.error(`✖ Failed to compile:\n ${err.message || err}`)
|
|
20
20
|
process.exit(1)
|
|
@@ -8,11 +8,8 @@ const protocol = HTTPS === 'true' ? 'https' : 'http'
|
|
|
8
8
|
const host = HOST || '0.0.0.0'
|
|
9
9
|
|
|
10
10
|
const getWatchOptions = ({context, watch}) => {
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
ignored: ignoredFiles(context)
|
|
14
|
-
}
|
|
15
|
-
: false
|
|
11
|
+
if (!watch) return false
|
|
12
|
+
return {ignored: ignoredFiles(context)}
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
module.exports = config => ({
|
|
@@ -35,9 +32,11 @@ module.exports = config => ({
|
|
|
35
32
|
historyApiFallback: {
|
|
36
33
|
disableDotRule: true
|
|
37
34
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
setupMiddlewares(middlewares, devServer) {
|
|
36
|
+
if (!devServer) throw new Error('webpack-dev-server is not defined')
|
|
37
|
+
|
|
38
|
+
middlewares.push(noopServiceWorkerMiddleware(config.output.publicPath))
|
|
39
|
+
|
|
40
|
+
return middlewares
|
|
42
41
|
}
|
|
43
42
|
})
|
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.27",
|
|
4
4
|
"description": "Config-free bundler for ES6 React apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sui-bundler": "./bin/sui-bundler.js"
|
|
@@ -25,31 +25,31 @@
|
|
|
25
25
|
"@s-ui/helpers": "1",
|
|
26
26
|
"@s-ui/sass-loader": "1",
|
|
27
27
|
"address": "1.1.2",
|
|
28
|
-
"autoprefixer": "10.4.
|
|
28
|
+
"autoprefixer": "10.4.2",
|
|
29
29
|
"babel-loader": "8.2.3",
|
|
30
30
|
"babel-preset-sui": "3",
|
|
31
31
|
"buffer": "6.0.3",
|
|
32
32
|
"commander": "8.3.0",
|
|
33
33
|
"css-loader": "6.5.1",
|
|
34
34
|
"css-minimizer-webpack-plugin": "3.3.1",
|
|
35
|
-
"esbuild
|
|
35
|
+
"esbuild": "0.14.11",
|
|
36
36
|
"escape-string-regexp": "4.0.0",
|
|
37
|
-
"fast-glob": "3.2.
|
|
37
|
+
"fast-glob": "3.2.10",
|
|
38
38
|
"find-free-ports": "3.0.0",
|
|
39
39
|
"html-webpack-plugin": "5.5.0",
|
|
40
|
-
"mini-css-extract-plugin": "2.4.
|
|
40
|
+
"mini-css-extract-plugin": "2.4.6",
|
|
41
41
|
"postcss": "8.4.5",
|
|
42
42
|
"postcss-loader": "6.2.1",
|
|
43
43
|
"process": "0.11.10",
|
|
44
44
|
"rimraf": "3.0.2",
|
|
45
|
-
"sass": "1.
|
|
45
|
+
"sass": "1.48.0",
|
|
46
46
|
"speed-measure-webpack-plugin": "1.5.0",
|
|
47
47
|
"strip-ansi": "6.0.1",
|
|
48
48
|
"style-loader": "3.3.1",
|
|
49
49
|
"url": "0.11.0",
|
|
50
|
-
"webpack": "5.
|
|
51
|
-
"webpack-dev-server": "4.7.
|
|
52
|
-
"webpack-manifest-plugin": "4.
|
|
50
|
+
"webpack": "5.66.0",
|
|
51
|
+
"webpack-dev-server": "4.7.3",
|
|
52
|
+
"webpack-manifest-plugin": "4.1.1",
|
|
53
53
|
"webpack-node-externals": "3.0.0"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/shared/minify-js.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const esbuild = ({sourceMap}) =>
|
|
4
|
-
new ESBuildMinifyPlugin({
|
|
5
|
-
target: 'es6',
|
|
6
|
-
sourcemap: sourceMap !== 'none' && sourceMap !== false
|
|
7
|
-
})
|
|
1
|
+
const TerserPlugin = require('terser-webpack-plugin')
|
|
8
2
|
|
|
9
3
|
module.exports = ({extractComments, sourceMap}) =>
|
|
10
|
-
|
|
4
|
+
new TerserPlugin({
|
|
5
|
+
minify: TerserPlugin.esbuildMinify,
|
|
6
|
+
terserOptions: {
|
|
7
|
+
target: 'es6',
|
|
8
|
+
sourcemap: sourceMap !== 'none' && sourceMap !== false
|
|
9
|
+
}
|
|
10
|
+
})
|
package/webpack.config.lib.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
const webpack = require('webpack')
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
cleanList,
|
|
4
|
+
envVars,
|
|
5
|
+
MAIN_ENTRY_POINT,
|
|
6
|
+
config
|
|
7
|
+
} = require('./shared/index.js')
|
|
3
8
|
const path = require('path')
|
|
4
|
-
const minifyJs = require('./shared/minify-js')
|
|
5
|
-
const definePlugin = require('./shared/define')
|
|
6
|
-
const babelRules = require('./shared/module-rules-babel')
|
|
7
|
-
const {extractComments, sourceMap} = require('./shared/config')
|
|
8
|
-
const {aliasFromConfig} = require('./shared/resolve-alias')
|
|
9
|
+
const minifyJs = require('./shared/minify-js.js')
|
|
10
|
+
const definePlugin = require('./shared/define.js')
|
|
11
|
+
const babelRules = require('./shared/module-rules-babel.js')
|
|
12
|
+
const {extractComments, sourceMap} = require('./shared/config.js')
|
|
13
|
+
const {aliasFromConfig} = require('./shared/resolve-alias.js')
|
|
9
14
|
|
|
10
15
|
module.exports = {
|
|
11
16
|
mode: 'production',
|
|
@@ -30,6 +35,7 @@ module.exports = {
|
|
|
30
35
|
optimization: {
|
|
31
36
|
// avoid looping over all the modules after the compilation
|
|
32
37
|
checkWasmTypes: false,
|
|
38
|
+
minimize: true,
|
|
33
39
|
minimizer: [minifyJs({extractComments, sourceMap})]
|
|
34
40
|
},
|
|
35
41
|
plugins: cleanList([
|
package/webpack.config.prod.js
CHANGED
|
@@ -9,21 +9,22 @@ 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
11
|
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
|
|
12
|
+
|
|
12
13
|
const {
|
|
13
14
|
when,
|
|
14
15
|
cleanList,
|
|
15
16
|
envVars,
|
|
16
17
|
MAIN_ENTRY_POINT,
|
|
17
18
|
config
|
|
18
|
-
} = require('./shared/index')
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const babelRules = require('./shared/module-rules-babel')
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
19
|
+
} = require('./shared/index.js')
|
|
20
|
+
const {aliasFromConfig} = require('./shared/resolve-alias.js')
|
|
21
|
+
const {extractComments, sourceMap} = require('./shared/config.js')
|
|
22
|
+
const {resolveLoader} = require('./shared/resolve-loader.js')
|
|
23
|
+
const babelRules = require('./shared/module-rules-babel.js')
|
|
24
|
+
const definePlugin = require('./shared/define.js')
|
|
25
|
+
const manifestLoaderRules = require('./shared/module-rules-manifest-loader.js')
|
|
26
|
+
const minifyCss = require('./shared/minify-css.js')
|
|
27
|
+
const minifyJs = require('./shared/minify-js.js')
|
|
27
28
|
|
|
28
29
|
const PUBLIC_PATH = process.env.CDN || config.cdn || '/'
|
|
29
30
|
|
|
@@ -70,6 +71,9 @@ const webpackConfig = {
|
|
|
70
71
|
runtimeChunk: true
|
|
71
72
|
},
|
|
72
73
|
plugins: cleanList([
|
|
74
|
+
new webpack.ProvidePlugin({
|
|
75
|
+
process: 'process/browser'
|
|
76
|
+
}),
|
|
73
77
|
new webpack.ids.HashedModuleIdsPlugin(),
|
|
74
78
|
new webpack.EnvironmentPlugin(envVars(config.env)),
|
|
75
79
|
definePlugin(),
|
package/webpack.config.server.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const webpack = require('webpack')
|
|
2
2
|
const webpackNodeExternals = require('webpack-node-externals')
|
|
3
3
|
const path = require('path')
|
|
4
|
-
const babelRules = require('./shared/module-rules-babel')
|
|
5
|
-
const manifestLoaderRules = require('./shared/module-rules-manifest-loader')
|
|
6
|
-
const {aliasFromConfig} = require('./shared/resolve-alias')
|
|
7
4
|
|
|
8
|
-
const {config, when, cleanList} = require('./shared')
|
|
9
|
-
const
|
|
5
|
+
const {config, when, cleanList} = require('./shared/index.js')
|
|
6
|
+
const babelRules = require('./shared/module-rules-babel.js')
|
|
7
|
+
const manifestLoaderRules = require('./shared/module-rules-manifest-loader.js')
|
|
8
|
+
const {aliasFromConfig} = require('./shared/resolve-alias.js')
|
|
9
|
+
const {resolveLoader} = require('./shared/resolve-loader.js')
|
|
10
10
|
|
|
11
11
|
const filename = '[name].[chunkhash:8].js'
|
|
12
12
|
|
|
@@ -31,6 +31,7 @@ const webpackConfig = {
|
|
|
31
31
|
},
|
|
32
32
|
optimization: {
|
|
33
33
|
checkWasmTypes: false,
|
|
34
|
+
minimize: true,
|
|
34
35
|
nodeEnv: false
|
|
35
36
|
},
|
|
36
37
|
externals: [webpackNodeExternals()],
|