-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(crypto): configure rollup (#2853)
- Loading branch information
1 parent
16a15e0
commit 6515a93
Showing
3 changed files
with
172 additions
and
1,844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import pkg from "./package.json"; | ||
import { terser } from "rollup-plugin-terser"; | ||
import commonjs from "rollup-plugin-commonjs"; | ||
import nodeResolve from "rollup-plugin-node-resolve"; | ||
import json from "rollup-plugin-json"; | ||
|
||
export default { | ||
input: "dist/index.js", // our source file | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: "cjs" | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: "es" // the preferred format | ||
}, | ||
{ | ||
file: pkg.browser, | ||
format: "iife", | ||
name: "ArkCrypto" // the global which can be used in a browser | ||
} | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies || {}) | ||
], | ||
plugins: [ | ||
json({ | ||
// for tree-shaking, properties will be declared as | ||
// variables, using either `var` or `const` | ||
preferConst: true, // Default: false | ||
|
||
// ignores indent and generates the smallest code | ||
compact: true, // Default: false | ||
}), | ||
nodeResolve({ | ||
jsnext: true, | ||
main: true | ||
}), | ||
commonjs({ | ||
namedExports: { | ||
"dist/index.js": ["__moduleExports"] | ||
} | ||
}), | ||
terser() // minifies generated bundles | ||
] | ||
}; |
Oops, something went wrong.