-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
56 lines (55 loc) · 1.63 KB
/
rollup.config.js
File metadata and controls
56 lines (55 loc) · 1.63 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
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import commonjs from 'rollup-plugin-commonjs'; // Convert CommonJS modules to ES6
import vue from 'rollup-plugin-vue'; // Handle .vue SFC files
import scss from 'rollup-plugin-scss';
import { terser } from 'rollup-plugin-terser';
import copy from 'rollup-plugin-copy';
import image from '@rollup/plugin-image';
export default {
input: 'src/index.ts', // our source file
output: [
{
name: 'test-lib',
file: 'dist/test-lib.umd.js',
format: 'umd',
sourcemap: true
}
// {
// // A self-executing function, suitable for inclusion as a <script> tag.
// name: 'test-lib',
// file: 'dist/test-lib.umd.min.js',
// format: 'iife',
// extend: true,
// sourcemap: true,
// plugins: [terser()]
// },
// {
// // CommonJS, suitable for Node and other bundlers
// name: 'test-lib',
// file: 'dist/test-lib.common.js',
// format: 'cjs',
// sourcemap: true
// }
],
external: [...Object.keys(pkg.dependencies || {})],
plugins: [
typescript({
useTsconfigDeclarationDir: true,
tsconfigOverride: { exclude: ['node_modules', 'src/components/', 'tests'] }
}),
// commonjs(),
vue({
css: true, // Dynamically inject css as a <style> tag
compileTemplate: true // Explicitly convert template to render function
})
// scss({
// output: 'dist/test-lib.css'
// }),
// copy({
// targets: [{ src: 'src/assets/sass/**', dest: 'dist/scss' }]
// }),
// image(),
// terser() // minifies generated bundles
]
};