This repository was archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrollup.config.js
More file actions
74 lines (61 loc) · 2.19 KB
/
Copy pathrollup.config.js
File metadata and controls
74 lines (61 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import nodeResolve from "rollup-plugin-node-resolve";
import uglify from "rollup-plugin-uglify";
import progress from "rollup-plugin-progress";
import sourcemaps from "rollup-plugin-sourcemaps";
import visualizer from "rollup-plugin-visualizer";
import copy from "rollup-plugin-copy";
import sass from "rollup-plugin-sass";
sass({
output: 'dist/bundle.css',
options: {
file: "src/w11k-select.scss"
}
});
var MINIFY = process.env.MINIFY;
var pkg = require('./package.json');
var banner = "/**";
banner += `
* @version v${pkg.version}
* @link ${pkg.homepage}
* @license MIT License, http://www.opensource.org/licenses/MIT
*/`;
var uglifyOpts = {output: {}};
// retain multiline comment with @license
uglifyOpts.output.comments = (node, comment) =>
comment.type === 'comment2' && /@license/i.test(comment.value);
var plugins = [
nodeResolve({jsnext: true}),
progress({clearLine: false}),
sourcemaps(),
copy({
"src/w11k-select.tpl.html": "dist/w11k-select.tpl.html",
"src/w11k-select-option/w11k-select-option.tpl.html": "dist/w11k-select-option.tpl.html",
"src/w11k-select.css": "dist/w11k-select.css",
"src/w11k-select.scss": "dist/w11k-select.scss",
"src/w11k-select.less": "dist/w11k-select.less",
"src/w11k-select-option/_w11k-select-options.scss": "dist/w11k-select-option/_w11k-select-options.scss",
"src/w11k-select-option/_w11k-select-options.less": "dist/w11k-select-option/_w11k-select-options.less",
"src/w11k-select-checkbox/_w11k-checkbox.directive.scss": "dist/w11k-select-checkbox/_w11k-checkbox.directive.scss",
"src/w11k-select-checkbox/_w11k-checkbox.directive.less": "dist/w11k-select-checkbox/_w11k-checkbox.directive.less",
verbose: true
}),
sass
];
if (MINIFY) plugins.push(uglify(uglifyOpts));
if (MINIFY) plugins.push(visualizer({sourcemap: true}));
var extension = MINIFY ? ".min.js" : ".js";
const BASE_CONFIG = {
sourceMap: true,
format: 'umd',
exports: 'named',
plugins: plugins,
banner: banner,
};
const CONFIG = Object.assign({
moduleName: 'w11k-select',
entry: 'lib-esm/index.js',
dest: 'dist/w11k-select' + extension,
globals: {angular: 'angular'},
external: ['angular'],
}, BASE_CONFIG);
export default CONFIG;