-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
34 lines (32 loc) · 1.15 KB
/
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 { defineConfig } from 'rollup';
// A Rollup plugin which locates modules using the Node resolution algorithm
import { nodeResolve } from '@rollup/plugin-node-resolve';
// A Rollup plugin to convert CommonJS modules to ES6, so they can be included in a Rollup bundle
import commonjs from '@rollup/plugin-commonjs';
// Use the latest JS features in your Rollup bundle
import babel from '@rollup/plugin-babel';
// Minifies the bundle
import terser from '@rollup/plugin-terser';
// Development: Enables a livereload server that watches for changes to CSS, JS, and Handlbars files
import { resolve } from "path";
import livereload from 'rollup-plugin-livereload';
// Rollup configuration
export default defineConfig({
input: 'assets/js/index.js',
output: {
dir: "assets/built",
sourcemap: true,
format: 'iife',
plugins: [terser()]
},
plugins: [
commonjs(),
nodeResolve(),
babel({ babelHelpers: 'bundled' }),
process.env.BUILD !== "production" && livereload({
watch: resolve('.'),
extraExts: ['hbs'],
exclusions: [resolve('node_modules')]
}),
]
})