forked from vue-styleguidist/vue-styleguidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
34 lines (33 loc) · 893 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
import * as path from 'path'
import nodeResolve from 'rollup-plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import commonjs from 'rollup-plugin-commonjs'
import pkg from './package.json'
const resolve = _path => path.resolve(__dirname, _path)
export default {
input: resolve('./src/index.ts'),
output: [
{
file: pkg.main,
name: 'vueInbrowserCompiler',
format: 'umd'
},
{
file: pkg.module,
format: 'es' // the preferred format
}
],
plugins: [
// allow rollup to look for modules in node_modules
nodeResolve(),
// Compile TypeScript files
typescript({
useTsconfigDeclarationDir: true,
tsconfig: './tsconfig.build.json',
cacheRoot: '../../node_modules/.rollup_vue-compiler_cache'
}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs()
],
external: Object.keys(pkg.dependencies)
}