UNPKG

1.13 kBJavaScriptView Raw
1import babel from 'rollup-plugin-babel';
2import stripBanner from 'rollup-plugin-strip-banner';
3import uglify from 'rollup-plugin-uglify';
4import * as path from 'path';
5
6const shouldMinify = process.env.NODE_ENV === 'production';
7
8export default {
9 input: 'src/index.js',
10 output: {
11 name: 'rebound',
12 file: path.join(
13 __dirname,
14 'dist',
15 shouldMinify ? 'rebound.min.js' : 'rebound.js',
16 ),
17 format: 'umd',
18 banner: `
19/**
20 * Copyright (c) 2013, Facebook, Inc.
21 * All rights reserved.
22 *
23 * This source code is licensed under the BSD-style license found in the
24 * LICENSE file in the root directory of this source tree. An additional grant
25 * of patent rights can be found in the PATENTS file in the same directory.
26 */
27 `.trim(),
28 },
29 plugins: [
30 babel({
31 plugins: ['external-helpers'],
32 exclude: 'node_modules/**',
33 }),
34 stripBanner({
35 exclude: 'node_modules/**/*',
36 sourceMap: true,
37 }),
38 shouldMinify &&
39 uglify({
40 compress: true,
41 mangle: true,
42 output: {
43 comments: /Copyright/,
44 },
45 }),
46 ],
47};