Skip to content

Commit

Permalink
Changed format
Browse files Browse the repository at this point in the history
  • Loading branch information
lopatnov committed Dec 7, 2019
1 parent 7efac25 commit 768e5df
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 40 deletions.
8 changes: 8 additions & 0 deletions dist/plugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { MinifyOptions } from 'uglify-js';
export default function uglify(options?: MinifyOptions): {
name: string;
transform(code: any): {
code: string;
map: string;
};
};
66 changes: 31 additions & 35 deletions dist/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lopatnov/rollup-plugin-uglify",
"version": "1.0.2",
"version": "1.1.0",
"description": "Rollup plugin. Javascript code minifier",
"author": "lopatnov",
"license": "Apache-2.0",
Expand Down Expand Up @@ -46,6 +46,7 @@
"typescript": "^3.7.3"
},
"peerDependencies": {
"rollup": "^1.27.8",
"uglify-js": "^3.7.1"
}
}
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export default
output: [
{
file: pkg.main,
format: "umd",
format: "cjs",
name: pkg.umdName,
sourcemap: true
},
{
file: pkg.module,
format: "es",
format: "esm",
sourcemap: true
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { minify, MinifyOptions } from 'uglify-js';
export default function uglify (options: MinifyOptions = {}) {
return {
name: 'uglify',
transform(code) {
transform(code: any) {
if (typeof options.sourceMap === 'undefined') {
options.sourceMap = true;
}
Expand Down
13 changes: 13 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "./dist",
"module": "es6",
"noImplicitAny": true,
"outDir": "./dist",
"target": "es5",
"esModuleInterop": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

0 comments on commit 768e5df

Please sign in to comment.