rollup-plugin-webpack-stats
Advanced tools
Comparing version 0.1.0 to 0.2.0
import { Plugin } from 'rollup'; | ||
import { BundleTransformOptions } from './transform'; | ||
export { bundleToWebpackStats } from './transform'; | ||
interface WebpackStatsOptions extends BundleTransformOptions { | ||
@@ -11,2 +12,1 @@ /** | ||
export declare const webpackStats: (options?: WebpackStatsOptions) => Plugin; | ||
export {}; |
@@ -74,3 +74,3 @@ 'use strict'; | ||
name: item.fileName, | ||
size: getByteSize(item.source) | ||
size: getByteSize(item.source.toString()) | ||
}); | ||
@@ -106,3 +106,4 @@ } | ||
exports.bundleToWebpackStats = bundleToWebpackStats; | ||
exports.webpackStats = webpackStats; | ||
//# sourceMappingURL=rollup-plugin-webpack-stats.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("path"))&&"object"==typeof e&&"default"in e?e.default:e;function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}var i=function(e){return"string"==typeof e?Buffer.from(e).length:(null==e?void 0:e.length)||0};exports.webpackStats=function(e){return void 0===e&&(e={}),{name:"webpackStats",generateBundle:function(a,r){var s,u=function(e,a){var r=n({moduleOriginalSize:!1},a),s=Object.values(e),u=[],o=[],l={};return s.forEach((function(e){if("chunk"===e.type){u.push({name:e.fileName,size:i(e.code)});var n=e.name;o.push({id:n,entry:e.isEntry,initial:!e.isDynamicEntry,files:[e.fileName],names:[e.name]}),Object.entries(e.modules).forEach((function(e){var i=e[1],a=e[0].replace("\0",""),s=t.relative(process.cwd(),a),u=s.match(/^\.\./)?s:"."+t.sep+s,o=l[u];o?o.chunks.push(n):l[u]={name:u,size:r.moduleOriginalSize?i.originalLength:i.renderedLength,chunks:[n]}}))}else"asset"===e.type&&u.push({name:e.fileName,size:i(e.source)})})),{builtAt:Date.now(),assets:u,chunks:o,modules:Object.values(l)}}(r,e);this.emitFile({type:"asset",fileName:(null==(s=e)?void 0:s.fileName)||"webpack-stats.json",source:JSON.stringify(u)})}}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("path"))&&"object"==typeof e&&"default"in e?e.default:e;function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var a=function(e){return"string"==typeof e?Buffer.from(e).length:(null==e?void 0:e.length)||0},i=function(e,i){var r=n({moduleOriginalSize:!1},i),s=Object.values(e),u=[],o=[],l={};return s.forEach((function(e){if("chunk"===e.type){u.push({name:e.fileName,size:a(e.code)});var n=e.name;o.push({id:n,entry:e.isEntry,initial:!e.isDynamicEntry,files:[e.fileName],names:[e.name]}),Object.entries(e.modules).forEach((function(e){var a=e[1],i=e[0].replace("\0",""),s=t.relative(process.cwd(),i),u=s.match(/^\.\./)?s:"."+t.sep+s,o=l[u];o?o.chunks.push(n):l[u]={name:u,size:r.moduleOriginalSize?a.originalLength:a.renderedLength,chunks:[n]}}))}else"asset"===e.type&&u.push({name:e.fileName,size:a(e.source.toString())})})),{builtAt:Date.now(),assets:u,chunks:o,modules:Object.values(l)}};exports.bundleToWebpackStats=i,exports.webpackStats=function(e){return void 0===e&&(e={}),{name:"webpackStats",generateBundle:function(t,n){var a,r=i(n,e);this.emitFile({type:"asset",fileName:(null==(a=e)?void 0:a.fileName)||"webpack-stats.json",source:JSON.stringify(r)})}}}; | ||
//# sourceMappingURL=rollup-plugin-webpack-stats.cjs.production.min.js.map |
@@ -68,3 +68,3 @@ import path from 'path'; | ||
name: item.fileName, | ||
size: getByteSize(item.source) | ||
size: getByteSize(item.source.toString()) | ||
}); | ||
@@ -100,3 +100,3 @@ } | ||
export { webpackStats }; | ||
export { bundleToWebpackStats, webpackStats }; | ||
//# sourceMappingURL=rollup-plugin-webpack-stats.esm.js.map |
{ | ||
"name": "rollup-plugin-webpack-stats", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"private": false, | ||
@@ -50,3 +50,3 @@ "license": "MIT", | ||
"husky": "^8.0.3", | ||
"rollup": "^1.32.1", | ||
"rollup": "^3.10.0", | ||
"size-limit": "^8.1.1", | ||
@@ -58,4 +58,4 @@ "tsdx": "^0.14.1", | ||
"peerDependencies": { | ||
"rollup": "^1.0.0" | ||
"rollup": "^3.0.0" | ||
} | ||
} |
@@ -5,2 +5,4 @@ import { Plugin } from 'rollup'; | ||
export { bundleToWebpackStats } from './transform'; | ||
const NAME = 'webpackStats'; | ||
@@ -7,0 +9,0 @@ |
@@ -122,3 +122,3 @@ import path from 'path'; | ||
name: item.fileName, | ||
size: getByteSize(item.source), | ||
size: getByteSize(item.source.toString()), | ||
}); | ||
@@ -125,0 +125,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39151
394