-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathrollup.config.mjs
45 lines (42 loc) · 1.31 KB
/
rollup.config.mjs
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
import dedent from 'dedent';
import fs from 'fs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import rollupCommonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
export default {
// Roll up directly from the src .ts files so that the generated source map
// refers to the .ts files' contents rather than the intermediary .js files'
// contents (such as in the './dist/es2015' directory)
input: './src/autolinker.ts',
output: {
file: './dist/autolinker.js',
format: 'umd',
name: 'Autolinker',
sourcemap: true,
banner: dedent`
/*!
* Autolinker.js
* v${pkg.version}
*
* Copyright(c) ${new Date().getFullYear()} ${pkg.author}
* ${pkg.license} License
*
* ${pkg.homepage}
*/
`,
},
plugins: [
nodeResolve({
browser: true,
}),
rollupCommonjs(),
typescript({
compilerOptions: {
module: 'esnext',
declaration: false, // don't need declaration files for the rolled up autolinker.js file
}
}),
],
treeshake: true,
};