@s-ui/bundler 9.41.0 → 9.43.0-beta.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.
@@ -19,6 +19,7 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production'
19
19
 
20
20
  program
21
21
  .option('-C, --clean', 'Remove public folder before create a new one')
22
+ .option('-S, --save-stats', 'Save stats.json in public folder')
22
23
  .option(
23
24
  '-l, --link-package [package]',
24
25
  'Replace each occurrence of this package with an absolute path to this folder',
@@ -43,6 +44,7 @@ program
43
44
  const {
44
45
  clean = false,
45
46
  context,
47
+ saveStats,
46
48
  linkPackage: packagesToLink = []
47
49
  } = program.opts()
48
50
 
@@ -88,6 +90,13 @@ compiler.run(async (error, stats) => {
88
90
 
89
91
  console.log(`Webpack stats: ${stats}`)
90
92
 
93
+ if (saveStats) {
94
+ const filePath = `${process.cwd()}/public/stats.json`
95
+ fs.writeFileSync(filePath, JSON.stringify(stats.toJson(), null, 2), {
96
+ encoding: 'utf8'
97
+ })
98
+ }
99
+
91
100
  const offlinePath = path.join(process.cwd(), 'src', 'offline.html')
92
101
  const offlinePageExists = fs.existsSync(offlinePath)
93
102
  const {offline: offlineConfig = {}} = projectConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "9.41.0",
3
+ "version": "9.43.0-beta.0",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -54,7 +54,7 @@ module.exports = {
54
54
  },
55
55
  plugins: cleanList([
56
56
  new webpack.ProvidePlugin({
57
- process: 'process/browser'
57
+ process: 'process/browser.js'
58
58
  }),
59
59
  new MiniCssExtractPlugin({
60
60
  filename: cssFileName,
@@ -84,7 +84,7 @@ const webpackConfig = {
84
84
  },
85
85
  plugins: cleanList([
86
86
  new webpack.ProvidePlugin({
87
- process: 'process/browser'
87
+ process: 'process/browser.js'
88
88
  }),
89
89
  new webpack.ids.HashedModuleIdsPlugin(),
90
90
  new webpack.EnvironmentPlugin(envVars(config.env)),