-
Notifications
You must be signed in to change notification settings - Fork 882
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
Showing
10 changed files
with
3,252 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
end_of_line = lf |
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 |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
npm-debug.log | ||
node_modules/ | ||
bower_components | ||
/nbproject/private/ | ||
/nbproject/private/ | ||
.vscode/ | ||
dist/ |
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,11 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
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,76 @@ | ||
import { rollup } from 'rollup'; | ||
const { terser } = require('rollup-plugin-terser'); | ||
const typescript = require('rollup-plugin-typescript'); | ||
|
||
const build = async () => { | ||
const buildEsm2015 = async () => { | ||
const esm2015Bundle = rollup({ | ||
input: 'src/index.ts', | ||
plugins: [typescript()] | ||
}); | ||
return (await esm2015Bundle).write({ | ||
file: 'dist/esm2015/croppie.js', | ||
format: 'esm', | ||
sourcemap: true | ||
}); | ||
}; | ||
|
||
const buildEsm5 = async () => { | ||
const esm5Bundle = rollup({ | ||
input: 'src/index.ts', | ||
plugins: [ | ||
typescript({ | ||
target: 'es5', | ||
declaration: false | ||
}) | ||
] | ||
}); | ||
return (await esm5Bundle).write({ | ||
file: 'dist/esm5/croppie.js', | ||
format: 'esm', | ||
sourcemap: true | ||
}); | ||
}; | ||
|
||
const buildUmd = async () => { | ||
const umdBundle = rollup({ | ||
input: 'src/index.ts', | ||
plugins: [ | ||
typescript({ | ||
target: 'es5' | ||
}) | ||
] | ||
}); | ||
return (await umdBundle).write({ | ||
file: 'dist/bundles/croppie.js', | ||
format: 'umd', | ||
sourcemap: true, | ||
name: 'Croppie' | ||
}); | ||
}; | ||
|
||
const buildUmdMinified = async () => { | ||
const umdMinifiedBundle = rollup({ | ||
input: 'src/index.ts', | ||
plugins: [ | ||
typescript({ | ||
target: 'es5' | ||
}), | ||
terser() | ||
] | ||
}); | ||
return (await umdMinifiedBundle).write({ | ||
file: 'dist/bundles/croppie.min.js', | ||
format: 'umd', | ||
sourcemap: true, | ||
name: 'Croppie' | ||
}); | ||
}; | ||
|
||
await buildEsm2015(); | ||
await buildEsm5(); | ||
await buildUmd(); | ||
await buildUmdMinified(); | ||
}; | ||
|
||
build().then((_) => console.log('Done')); |
Oops, something went wrong.