Skip to content

Commit 768e5df

Browse files
committed
Changed format
1 parent 7efac25 commit 768e5df

File tree

7 files changed

+58
-40
lines changed

7 files changed

+58
-40
lines changed

dist/plugin.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { MinifyOptions } from 'uglify-js';
2+
export default function uglify(options?: MinifyOptions): {
3+
name: string;
4+
transform(code: any): {
5+
code: string;
6+
map: string;
7+
};
8+
};

dist/plugin.js

Lines changed: 31 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lopatnov/rollup-plugin-uglify",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "Rollup plugin. Javascript code minifier",
55
"author": "lopatnov",
66
"license": "Apache-2.0",
@@ -46,6 +46,7 @@
4646
"typescript": "^3.7.3"
4747
},
4848
"peerDependencies": {
49+
"rollup": "^1.27.8",
4950
"uglify-js": "^3.7.1"
5051
}
5152
}

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export default
1111
output: [
1212
{
1313
file: pkg.main,
14-
format: "umd",
14+
format: "cjs",
1515
name: pkg.umdName,
1616
sourcemap: true
1717
},
1818
{
1919
file: pkg.module,
20-
format: "es",
20+
format: "esm",
2121
sourcemap: true
2222
}
2323
],

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { minify, MinifyOptions } from 'uglify-js';
33
export default function uglify (options: MinifyOptions = {}) {
44
return {
55
name: 'uglify',
6-
transform(code) {
6+
transform(code: any) {
77
if (typeof options.sourceMap === 'undefined') {
88
options.sourceMap = true;
99
}

tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"declarationDir": "./dist",
5+
"module": "es6",
6+
"noImplicitAny": true,
7+
"outDir": "./dist",
8+
"target": "es5",
9+
"esModuleInterop": true
10+
},
11+
"include": ["src/**/*"],
12+
"exclude": ["node_modules"]
13+
}

0 commit comments

Comments
 (0)