-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
68 lines (66 loc) · 1.91 KB
/
rollup.config.js
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
import svg from 'rollup-plugin-svg-import';
import postcss from 'rollup-plugin-postcss';
import typescript from '@rollup/plugin-typescript';
import del from 'rollup-plugin-delete';
import copy from 'rollup-plugin-copy';
import path from 'path';
import banner2 from 'rollup-plugin-banner2'
import { readFileSync } from 'fs';
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
const banner =
`/*!
* ${pkg.name} - v${pkg.version}
* ${pkg.homepage}
* Built: ${new Date()}
*/
`;
export default {
input: 'src/ol-pdf-printer.ts',
output: [
{
file: 'lib/ol-pdf-printer.js',
format: 'es',
sourcemap: true
}
],
plugins: [
banner2(() => banner),
del({ targets: 'lib/*' }),
typescript({
outDir: 'lib',
outputToFilesystem: true,
declarationMap: true,
incremental: false
}),
svg(),
postcss({
include: 'src/assets/scss/-ol-pdf-printer.bootstrap5.scss',
extensions: ['.css', '.sass', '.scss'],
extract: path.resolve('lib/style/css/ol-pdf-printer.bootstrap5.css'),
config: {
path: './postcss.config.cjs',
ctx: {
isDev: false
}
}
}),
postcss({
include: 'src/assets/scss/ol-pdf-printer.scss',
extensions: ['.css', '.sass', '.scss'],
inject: false,
extract: path.resolve('lib/style/css/ol-pdf-printer.css'),
config: {
path: './postcss.config.cjs',
ctx: {
isDev: false
}
}
}),
copy({
targets: [
{ src: 'src/assets/scss', dest: 'lib/style' }
]
})
],
external: id => !(path.isAbsolute(id) || id.startsWith("."))
};