rollup-plugin-stats 0.1.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/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/dist/rollup-plugin-stats.cjs.development.js +24 -0
- package/dist/rollup-plugin-stats.cjs.development.js.map +1 -0
- package/dist/rollup-plugin-stats.cjs.production.min.js +2 -0
- package/dist/rollup-plugin-stats.cjs.production.min.js.map +1 -0
- package/dist/rollup-plugin-stats.esm.js +20 -0
- package/dist/rollup-plugin-stats.esm.js.map +1 -0
- package/package.json +55 -0
- package/src/index.ts +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Vio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# rollup-plugin-stats
|
|
2
|
+
|
|
3
|
+
> **Warning**
|
|
4
|
+
> Under active development
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/rollup-plugin-stats)
|
|
7
|
+

|
|
8
|
+
[](https://github.com/vio/rollup-plugin-stats/actions/workflows/main.yml)
|
|
9
|
+
|
|
10
|
+
Output Rollup stats JSON file
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
npm install --dev rollup-plugin-stats
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
yarn add --dev rollup-plugin-stats
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Configure
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
// rollup.config.js
|
|
29
|
+
const { rollupStats } = require('rollup-plugin-stats');
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
plugins: [
|
|
33
|
+
// add it as the last plugin
|
|
34
|
+
rollupStats(),
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
```
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var NAME = 'rollupStats';
|
|
6
|
+
var rollupStats = function rollupStats(options) {
|
|
7
|
+
if (options === void 0) {
|
|
8
|
+
options = {};
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
name: NAME,
|
|
12
|
+
generateBundle: function generateBundle(_, bundle) {
|
|
13
|
+
var _options;
|
|
14
|
+
this.emitFile({
|
|
15
|
+
type: 'asset',
|
|
16
|
+
fileName: ((_options = options) == null ? void 0 : _options.fileName) || 'stats.json',
|
|
17
|
+
source: JSON.stringify(bundle, null, 2)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.rollupStats = rollupStats;
|
|
24
|
+
//# sourceMappingURL=rollup-plugin-stats.cjs.development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup-plugin-stats.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["NAME","rollupStats","options","name","generateBundle","_","bundle","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":";;;;AAEA,IAAMA,IAAI,GAAG,aAAa;IAUbC,WAAW,GAAG,SAAdA,WAAWA,CAAIC;MAAAA;IAAAA,UAA8B,EAAE;;EAAA,OAAc;IACxEC,IAAI,EAAEH,IAAI;IACVI,cAAc,WAAAA,eAACC,CAAC,EAAEC,MAAM;;MACtB,IAAI,CAACC,QAAQ,CAAC;QACZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE,EAAAC,QAAA,GAAAR,OAAO,qBAAPQ,QAAA,CAASD,QAAQ,KAAI,YAAY;QAC3CE,MAAM,EAAEC,IAAI,CAACC,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC;OACvC,CAAC;;GAEL;AAAA;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rollupStats=function(e){return void 0===e&&(e={}),{name:"rollupStats",generateBundle:function(t,s){var l;this.emitFile({type:"asset",fileName:(null==(l=e)?void 0:l.fileName)||"stats.json",source:JSON.stringify(s,null,2)})}}};
|
|
2
|
+
//# sourceMappingURL=rollup-plugin-stats.cjs.production.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup-plugin-stats.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["options","name","generateBundle","_","bundle","this","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":"wFAY2B,SAACA,GAAgC,gBAAhCA,IAAAA,EAA8B,IAAgB,CACxEC,KAXW,cAYXC,wBAAeC,EAAGC,SAChBC,KAAKC,SAAS,CACZC,KAAM,QACNC,iBAAUC,EAAAT,UAAAS,EAASD,WAAY,aAC/BE,OAAQC,KAAKC,UAAUR,EAAQ,KAAM"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var NAME = 'rollupStats';
|
|
2
|
+
var rollupStats = function rollupStats(options) {
|
|
3
|
+
if (options === void 0) {
|
|
4
|
+
options = {};
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
name: NAME,
|
|
8
|
+
generateBundle: function generateBundle(_, bundle) {
|
|
9
|
+
var _options;
|
|
10
|
+
this.emitFile({
|
|
11
|
+
type: 'asset',
|
|
12
|
+
fileName: ((_options = options) == null ? void 0 : _options.fileName) || 'stats.json',
|
|
13
|
+
source: JSON.stringify(bundle, null, 2)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { rollupStats };
|
|
20
|
+
//# sourceMappingURL=rollup-plugin-stats.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup-plugin-stats.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["NAME","rollupStats","options","name","generateBundle","_","bundle","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":"AAEA,IAAMA,IAAI,GAAG,aAAa;IAUbC,WAAW,GAAG,SAAdA,WAAWA,CAAIC;MAAAA;IAAAA,UAA8B,EAAE;;EAAA,OAAc;IACxEC,IAAI,EAAEH,IAAI;IACVI,cAAc,WAAAA,eAACC,CAAC,EAAEC,MAAM;;MACtB,IAAI,CAACC,QAAQ,CAAC;QACZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE,EAAAC,QAAA,GAAAR,OAAO,qBAAPQ,QAAA,CAASD,QAAQ,KAAI,YAAY;QAC3CE,MAAM,EAAEC,IAAI,CAACC,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC;OACvC,CAAC;;GAEL;AAAA;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rollup-plugin-stats",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"private": false,
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Viorel Cojocaru",
|
|
8
|
+
"email": "vio@beanon.com",
|
|
9
|
+
"url": "https://beanon.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/vio/rollup-plugin-stats.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"rollup",
|
|
17
|
+
"plugin",
|
|
18
|
+
"stats"
|
|
19
|
+
],
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"typings": "dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"start": "tsdx watch",
|
|
31
|
+
"build": "tsdx build",
|
|
32
|
+
"test": "tsdx test --passWithNoTests",
|
|
33
|
+
"lint": "tsdx lint src",
|
|
34
|
+
"prepare": "tsdx build"
|
|
35
|
+
},
|
|
36
|
+
"husky": {
|
|
37
|
+
"hooks": {
|
|
38
|
+
"pre-commit": "tsdx lint"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"prettier": {
|
|
42
|
+
"printWidth": 80,
|
|
43
|
+
"semi": true,
|
|
44
|
+
"singleQuote": true,
|
|
45
|
+
"trailingComma": "es5"
|
|
46
|
+
},
|
|
47
|
+
"module": "dist/rollup-plugin-stats.esm.js",
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"husky": "^8.0.3",
|
|
50
|
+
"rollup": "^1.32.1",
|
|
51
|
+
"tsdx": "^0.14.1",
|
|
52
|
+
"tslib": "^2.5.0",
|
|
53
|
+
"typescript": "^5.0.4"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
|
|
3
|
+
const NAME = 'rollupStats';
|
|
4
|
+
|
|
5
|
+
interface rollupStatsOptions {
|
|
6
|
+
/**
|
|
7
|
+
* JSON file output fileName
|
|
8
|
+
* default: stats.json
|
|
9
|
+
*/
|
|
10
|
+
fileName?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({
|
|
14
|
+
name: NAME,
|
|
15
|
+
generateBundle(_, bundle) {
|
|
16
|
+
this.emitFile({
|
|
17
|
+
type: 'asset',
|
|
18
|
+
fileName: options?.fileName || 'stats.json',
|
|
19
|
+
source: JSON.stringify(bundle, null, 2),
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
});
|