forked from danirus/django-comments-xtd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
37 lines (32 loc) · 904 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
'use strict';
const path = require('node:path');
const { babel } = require('@rollup/plugin-babel');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const pkg = require('./package.json');
const STATIC_DIR = path.resolve(
__dirname, 'django_comments_xtd', 'static', 'django_comments_xtd', 'js'
);
const SOURCE_DIR = path.resolve(STATIC_DIR, 'src');
const plugins = [
babel({
exclude: 'node_modules/**',
babelHelpers: 'bundled',
}),
nodeResolve()
];
module.exports = {
input: path.resolve(SOURCE_DIR, 'index.jsx'),
output: {
format: 'iife',
generatedCode: 'es2015',
file: path.resolve(STATIC_DIR, `django-comments-xtd-${pkg.version}.js`),
globals: {
'django': 'django',
'react': 'React',
'react-dom': 'ReactDOM',
'remarkable': 'remarkable',
}
},
plugins,
external: ['django', 'react', 'react-dom', 'remarkable'],
};