forked from travist/jsencrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dpronin
committed
Dec 20, 2017
1 parent
47f02a5
commit 75d6238
Showing
13 changed files
with
15,533 additions
and
15,273 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,47 +1,48 @@ | ||
"use strict"; | ||
const path = require('path'); | ||
const rollup = require('rollup'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const uglify = require('rollup-plugin-uglify'); | ||
const pkg = require('./package.json'); | ||
|
||
var plugins = [ | ||
resolve(), | ||
uglify({ | ||
mangle: true, | ||
warnings: true, | ||
output: { | ||
beautify: false, | ||
}, | ||
compress: { | ||
join_vars: true, | ||
if_return: true, | ||
properties: true, | ||
conditionals: true, | ||
warnings: true, | ||
dead_code: true, | ||
drop_console: true, | ||
drop_debugger: true, | ||
} | ||
}) | ||
]; | ||
|
||
|
||
const entries = { | ||
'src/JSEncrypt': {file: 'bin/jsencrypt.bundle', name: 'jsencrypt'}, | ||
'test/test.rsa': {file: 'test/test.rsa.bundle', name: 'rsaTest'} | ||
}; | ||
for (let entry in entries) { | ||
console.log(`processing ${entry}.js`); | ||
rollup.rollup({ | ||
input: path.join(__dirname, `${entry}.js`), | ||
plugins: [ | ||
resolve(), | ||
uglify({ | ||
mangle: true, | ||
warnings: true, | ||
output: { | ||
beautify: false, | ||
}, | ||
compress: { | ||
join_vars: true, | ||
if_return: true, | ||
properties: true, | ||
conditionals: true, | ||
warnings: true, | ||
dead_code: true, | ||
drop_console: true, | ||
drop_debugger: true, | ||
} | ||
}) | ||
export default [ | ||
// { | ||
// input: "./src/JSEncrypt.js", | ||
// plugins: plugins, | ||
// name: "JSEncrypt", | ||
// output: [ | ||
// { file: pkg.browser, format: 'umd' }, | ||
// ] | ||
// | ||
// }, | ||
{ | ||
input: "./src/JSEncrypt.js", | ||
plugins: plugins, | ||
name: "JSEncrypt", | ||
output: [ | ||
{ file: pkg.main, format: 'umd' }, | ||
// { file: pkg.module, format: 'es' } | ||
] | ||
}).then(function (bundle) { | ||
console.log(`processing ${entry}.js finished`); | ||
bundle.write({ | ||
format: 'umd', | ||
name: entries[entry].name, | ||
file: path.join(__dirname, `${entries[entry].file}.js`) | ||
}); | ||
}).catch((e)=>{ | ||
console.log(e); | ||
}); | ||
} | ||
|
||
} | ||
] |
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
Oops, something went wrong.