-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
44 lines (42 loc) · 1013 Bytes
/
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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import postcss from 'rollup-plugin-postcss';
import { readFileSync } from 'fs';
// Get package.json
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
export default {
input: 'src/search.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'GhostMeilisearchSearch',
sourcemap: true
},
{
file: 'dist/search.min.js',
format: 'umd',
name: 'GhostMeilisearchSearch',
plugins: [terser()],
sourcemap: true
}
],
onwarn(warning, warn) {
// Suppress circular dependency warnings from meilisearch
if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('meilisearch')) {
return;
}
warn(warning);
},
plugins: [
resolve({
browser: true
}),
commonjs(),
postcss({
extract: 'styles.css',
minimize: true
})
]
};