-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
67 lines (65 loc) · 1.82 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
import image from '@rollup/plugin-image';
import typescript from '@rollup/plugin-typescript';
import del from 'rollup-plugin-delete';
import copy from 'rollup-plugin-copy';
import postcss from 'rollup-plugin-postcss';
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-wfst.ts',
output: [
{
file: 'lib/ol-wfst.js',
format: 'es',
sourcemap: true
}
],
plugins: [
del({ targets: 'lib/*' }),
banner2(() => banner),
typescript({
outDir: './lib',
outputToFilesystem: true,
declarationMap: true,
incremental: false
}),
image(),
postcss({
include: 'src/assets/scss/-ol-wfst.bootstrap5.scss',
extensions: ['.css', '.sass', '.scss'],
extract: path.resolve('lib/style/css/ol-wfst.bootstrap5.css'),
config: {
path: './postcss.config.cjs',
ctx: {
isDev: false
}
}
}),
postcss({
include: 'src/assets/scss/ol-wfst.scss',
extensions: ['.css', '.sass', '.scss'],
extract: path.resolve('lib/style/css/ol-gisify.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("."))
};