UNPKG

agljs

Version:

AGL.js is a lightweight framework for integrating web apps with Epic's Active Guidelines platform, using modern JavaScript features. Manage action queuing, event handling, subscriptions, and state within Epic Hyperspace.

55 lines (51 loc) 1.39 kB
import typescript from '@rollup/plugin-typescript' import terser from '@rollup/plugin-terser' import { defineConfig } from 'rollup' import fs from 'fs' import path from 'path' const inputFile = path.resolve('ts/AGL.ts') function getTopBanner() { const match = fs.readFileSync(inputFile, 'utf8').match(/^\/\*![\s\S]*?\*\//) return match ? match[0] : '' } export default defineConfig([ { input: inputFile, output: [ { name: 'agl', file: 'js/agl.js', format: 'iife', sourcemap: true, plugins: [ terser({ compress: false, mangle: false, format: { comments: false, beautify: true, preamble: getTopBanner() } }) ] }, { name: 'agl', file: 'js/agl.min.js', format: 'umd', sourcemap: true, banner: getTopBanner(), plugins: [terser({ format: { comments: false, preamble: getTopBanner() } })] } ], plugins: [ typescript({ removeComments: true, declaration: false }) ] } ])