@s-ui/bundler 9.37.0 → 9.38.0
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 +1 -1
- package/bin/sui-bundler.js +1 -1
- package/package.json +1 -1
- package/shared/config.js +1 -1
- package/shared/module-rules-babel.js +2 -2
- package/webpack.config.dev.js +2 -1
- package/webpack.config.lib.js +6 -2
- package/webpack.config.prod.js +1 -1
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ This tool works with zero configuration out the box but you could use some confi
|
|
|
163
163
|
{
|
|
164
164
|
"config": {
|
|
165
165
|
"sui-bundler": {
|
|
166
|
-
"supportLegacyBrowsers":
|
|
166
|
+
"supportLegacyBrowsers": true, // default
|
|
167
167
|
"onlyHash": "true",
|
|
168
168
|
"env": ["APP_NAME", ["USER", "DEFAULT_VALUE"]],
|
|
169
169
|
"vendor": ["react", "react-dom"],
|
package/bin/sui-bundler.js
CHANGED
|
@@ -11,7 +11,7 @@ program
|
|
|
11
11
|
.command('lib', 'Compile a library to a bundle with chunks.')
|
|
12
12
|
.command(
|
|
13
13
|
'analyzer',
|
|
14
|
-
'Compile all assets and create a HTML
|
|
14
|
+
'Compile all assets and create a HTML inspector for your bundle'
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
program.parse(process.argv)
|
package/package.json
CHANGED
package/shared/config.js
CHANGED
|
@@ -5,7 +5,7 @@ const EXCLUDED_FOLDERS_REGEXP = new RegExp(
|
|
|
5
5
|
`node_modules(?!${path.sep}@s-ui(${path.sep}studio)(${path.sep}workbench)?${path.sep}src)`
|
|
6
6
|
)
|
|
7
7
|
|
|
8
|
-
module.exports = ({isServer = false} = {}) => ({
|
|
8
|
+
module.exports = ({isServer = false, supportLegacyBrowsers = true} = {}) => ({
|
|
9
9
|
test: /\.jsx?$/,
|
|
10
10
|
exclude: EXCLUDED_FOLDERS_REGEXP,
|
|
11
11
|
use: [
|
|
@@ -21,7 +21,7 @@ module.exports = ({isServer = false} = {}) => ({
|
|
|
21
21
|
require.resolve('babel-preset-sui'),
|
|
22
22
|
{
|
|
23
23
|
isServer,
|
|
24
|
-
|
|
24
|
+
isModern: !supportLegacyBrowsers,
|
|
25
25
|
targets: config.targets
|
|
26
26
|
}
|
|
27
27
|
]
|
package/webpack.config.dev.js
CHANGED
|
@@ -14,6 +14,7 @@ const {
|
|
|
14
14
|
const definePlugin = require('./shared/define.js')
|
|
15
15
|
const manifestLoaderRules = require('./shared/module-rules-manifest-loader.js')
|
|
16
16
|
const {aliasFromConfig, defaultAlias} = require('./shared/resolve-alias.js')
|
|
17
|
+
const {supportLegacyBrowsers} = require('./shared/config.js')
|
|
17
18
|
|
|
18
19
|
const {resolveLoader} = require('./shared/resolve-loader.js')
|
|
19
20
|
const createBabelRules = require('./shared/module-rules-babel.js')
|
|
@@ -82,7 +83,7 @@ const webpackConfig = {
|
|
|
82
83
|
resolveLoader,
|
|
83
84
|
module: {
|
|
84
85
|
rules: cleanList([
|
|
85
|
-
createBabelRules(),
|
|
86
|
+
createBabelRules({supportLegacyBrowsers}),
|
|
86
87
|
{
|
|
87
88
|
test: /(\.css|\.scss)$/,
|
|
88
89
|
use: cleanList([
|
package/webpack.config.lib.js
CHANGED
|
@@ -11,7 +11,11 @@ const minifyJs = require('./shared/minify-js.js')
|
|
|
11
11
|
const definePlugin = require('./shared/define.js')
|
|
12
12
|
const createBabelRules = require('./shared/module-rules-babel.js')
|
|
13
13
|
const sassRules = require('./shared/module-rules-sass.js')
|
|
14
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
extractComments,
|
|
16
|
+
sourceMap,
|
|
17
|
+
supportLegacyBrowsers
|
|
18
|
+
} = require('./shared/config.js')
|
|
15
19
|
const {aliasFromConfig} = require('./shared/resolve-alias.js')
|
|
16
20
|
|
|
17
21
|
const cssFileName = 'styles.css'
|
|
@@ -63,6 +67,6 @@ module.exports = {
|
|
|
63
67
|
definePlugin()
|
|
64
68
|
]),
|
|
65
69
|
module: {
|
|
66
|
-
rules: [createBabelRules(), sassRules]
|
|
70
|
+
rules: [createBabelRules({supportLegacyBrowsers}), sassRules]
|
|
67
71
|
}
|
|
68
72
|
}
|
package/webpack.config.prod.js
CHANGED
|
@@ -114,7 +114,7 @@ const webpackConfig = {
|
|
|
114
114
|
]),
|
|
115
115
|
module: {
|
|
116
116
|
rules: cleanList([
|
|
117
|
-
createBabelRules(),
|
|
117
|
+
createBabelRules({supportLegacyBrowsers}),
|
|
118
118
|
sassRules,
|
|
119
119
|
when(config['externals-manifest'], () =>
|
|
120
120
|
manifestLoaderRules(config['externals-manifest'])
|