Skip to content

Commit aa65d4c

Browse files
committed
Build uglified Control.Geocoder.min.js as well
1 parent a667012 commit aa65d4c

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build:img": "cpr images/ dist/images/ --overwrite",
1212
"test": "npm run lint",
1313
"lint": "npm run lint:js && npm run lint:css",
14-
"lint:js": "eslint 'src/**'",
14+
"lint:js": "eslint 'src/**' '*.js'",
1515
"lint:css": "prettier --list-different '*.css'",
1616
"publish": "sh ./scripts/publish.sh",
1717
"postpublish": "sh ./scripts/postpublish.sh"
@@ -45,6 +45,8 @@
4545
"eslint": "^4.15.0",
4646
"eslint-plugin-prettier": "^2.4.0",
4747
"prettier": "^1.9.2",
48-
"rollup": "^0.53.2"
48+
"rollup": "^0.65.0",
49+
"rollup-plugin-uglify": "^5.0.2",
50+
"uglify-js": "^3.4.9"
4951
}
5052
}

rollup.config.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pkg from './package.json';
2+
import { uglify } from 'rollup-plugin-uglify';
23

34
var banner =
45
'/* @preserve\n' +
@@ -12,7 +13,7 @@ var banner =
1213
' * All rights reserved.\n' +
1314
' */\n';
1415

15-
export default {
16+
const config = Object.freeze({
1617
input: 'src/index.js',
1718
external: ['leaflet'],
1819
output: {
@@ -25,4 +26,20 @@ export default {
2526
},
2627
banner: banner
2728
}
28-
};
29+
});
30+
31+
export default [
32+
config,
33+
Object.assign({}, config, {
34+
plugins: [
35+
uglify({
36+
output: {
37+
comments: 'some'
38+
}
39+
})
40+
],
41+
output: Object.assign({}, config.output, {
42+
file: 'dist/Control.Geocoder.min.js'
43+
})
44+
})
45+
];

0 commit comments

Comments
 (0)