-
-
Notifications
You must be signed in to change notification settings - Fork 444
Expand file tree
/
Copy pathrollup.config.js
More file actions
43 lines (40 loc) · 964 Bytes
/
rollup.config.js
File metadata and controls
43 lines (40 loc) · 964 Bytes
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
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import terser from '@rollup/plugin-terser'
import { version } from './package.json'
const getDate = () => {
const date = new Date()
return date.toISOString().split('T')[0] // Returns date in YYYY-MM-DD format
}
const banner = `/*!
* HTMLHint v${version}
* https://htmlhint.com
* Built on: ${getDate()}
* Copyright (c) ${new Date().getFullYear()} HTMLHint
* Licensed under MIT License
*/`
export default {
input: './dist/core/core.js',
output: {
file:
process.env.NODE_ENV === 'production'
? 'dist/htmlhint.min.js'
: 'dist/htmlhint.js',
format: 'umd',
name: 'HTMLHint',
banner,
},
plugins: [
commonjs(),
resolve(),
...(process.env.NODE_ENV === 'production'
? [
terser({
format: {
comments: /^!/,
},
}),
]
: []),
],
}