package-build-stats 8.2.0 → 8.2.1

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
@@ -5,7 +5,7 @@ This is the function that powers the core of building, minifying and gzipping of
5
5
  ## Usage
6
6
 
7
7
  ```js
8
- const { getPackageStats } = require('package-build-stats')
8
+ import { getPackageStats } from 'package-build-stats'
9
9
  ```
10
10
 
11
11
  #### Building packages from npm
package/bin/cli.js CHANGED
@@ -1,5 +1,8 @@
1
- require('esbuild-register/dist/node').register({
1
+ #!/usr/bin/env node
2
+ import { register } from 'esbuild-register/dist/node.js'
3
+
4
+ register({
2
5
  target: 'es2020',
3
6
  })
4
7
 
5
- require('./cli.ts')
8
+ await import('./cli.ts')
@@ -1,6 +1,8 @@
1
1
  import autoprefixer from 'autoprefixer';
2
2
  import escapeRegex from 'escape-string-regexp';
3
3
  import rspack from '@rspack/core';
4
+ import { createRequire } from 'module';
5
+ const require = createRequire(import.meta.url);
4
6
  export default function makeRspackConfig({ packageName: _packageName, entry, externals, debug: _debug, minify = true, }) {
5
7
  const externalsRegex = makeExternalsRegex(externals.externalPackages);
6
8
  const isExternalRequest = (request) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "package-build-stats",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "type": "module",
5
5
  "author": "Shubham Kanodia <shubham.kanodia10@gmail.com>",
6
6
  "repository": "https://github.com/pastelsky/package-build-stats",
@@ -3,6 +3,9 @@ import autoprefixer from 'autoprefixer'
3
3
  import escapeRegex from 'escape-string-regexp'
4
4
  import type { Entry, Configuration } from '@rspack/core'
5
5
  import rspack from '@rspack/core'
6
+ import { createRequire } from 'module'
7
+
8
+ const require = createRequire(import.meta.url)
6
9
 
7
10
  import { Externals } from '../common.types.js'
8
11