mirror of
https://github.com/0x5eal/rbxts-pako.git
synced 2025-04-10 22:00:58 +01:00
browserify => rollup.js
This commit is contained in:
parent
2cfc22b817
commit
5b28b9ad26
5 changed files with 58 additions and 11 deletions
|
@ -12,6 +12,7 @@ globals:
|
||||||
ignorePatterns:
|
ignorePatterns:
|
||||||
- coverage/
|
- coverage/
|
||||||
- dist/
|
- dist/
|
||||||
|
- rollup.config.js
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
accessor-pairs: 2
|
accessor-pairs: 2
|
||||||
|
|
|
@ -394,7 +394,9 @@ function gzip(input, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
exports.Deflate = Deflate;
|
module.exports = {
|
||||||
exports.deflate = deflate;
|
Deflate: Deflate,
|
||||||
exports.deflateRaw = deflateRaw;
|
deflate: deflate,
|
||||||
exports.gzip = gzip;
|
deflateRaw: deflateRaw,
|
||||||
|
gzip: gzip
|
||||||
|
};
|
||||||
|
|
|
@ -417,7 +417,9 @@ function inflateRaw(input, options) {
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
exports.Inflate = Inflate;
|
module.exports = {
|
||||||
exports.inflate = inflate;
|
Inflate: Inflate,
|
||||||
exports.inflateRaw = inflateRaw;
|
inflate: inflate,
|
||||||
exports.ungzip = inflate;
|
inflateRaw: inflateRaw,
|
||||||
|
ungzip: inflate
|
||||||
|
};
|
||||||
|
|
|
@ -27,17 +27,20 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"test": "npm run lint && mocha",
|
"test": "npm run lint && mocha",
|
||||||
"coverage": "npm run lint && nyc mocha && nyc report --reporter html"
|
"coverage": "npm run lint && nyc mocha && nyc report --reporter html",
|
||||||
|
"build": "rollup -c"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^16.2.3",
|
"@rollup/plugin-commonjs": "^16.0.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^10.0.0",
|
||||||
"buffer-from": "^1.1.1",
|
"buffer-from": "^1.1.1",
|
||||||
"eslint": "^7.13.0",
|
"eslint": "^7.13.0",
|
||||||
"mocha": "^8.2.1",
|
"mocha": "^8.2.1",
|
||||||
"multiparty": "^4.1.3",
|
"multiparty": "^4.1.3",
|
||||||
"ndoc": "^5.0.1",
|
"ndoc": "^5.0.1",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"uglify-js": "=3.4.8"
|
"rollup": "^2.33.1",
|
||||||
|
"rollup-plugin-terser": "^7.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
}
|
}
|
||||||
|
|
39
rollup.config.js
Normal file
39
rollup.config.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import nodeResolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import pkg from './package.json';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const banner = {
|
||||||
|
banner() {
|
||||||
|
return `/*! ${pkg.name} ${pkg.version} https://github.com/${pkg.repository} @license ${pkg.license} */`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const plugins = [ nodeResolve(), commonjs(), banner ];
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
input: 'index.js',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/pako.js', format: 'umd', name: 'pako' },
|
||||||
|
{ file: 'dist/pako.min.js', format: 'umd', name: 'pako', plugins: [ terser() ] }
|
||||||
|
],
|
||||||
|
plugins: plugins
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'lib/deflate.js',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/pako_deflate.js', format: 'umd', name: 'pako' },
|
||||||
|
{ file: 'dist/pako_deflate.min.js', format: 'umd', name: 'pako', plugins: [ terser() ] }
|
||||||
|
],
|
||||||
|
plugins: plugins
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'lib/inflate.js',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/pako_inflate.js', format: 'umd', name: 'pako' },
|
||||||
|
{ file: 'dist/pako_inflate.min.js', format: 'umd', name: 'pako', plugins: [ terser() ] }
|
||||||
|
],
|
||||||
|
plugins: plugins
|
||||||
|
}
|
||||||
|
];
|
Loading…
Add table
Reference in a new issue