2020-09-04 17:45:23 +00:00
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
import { babel } from '@rollup/plugin-babel';
|
|
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
import license from 'rollup-plugin-license';
|
|
|
|
import replace from '@rollup/plugin-replace';
|
|
|
|
|
|
|
|
const licenseLine = {
|
2024-09-14 15:47:32 +00:00
|
|
|
banner: `/*! VDM Uikit v${require('./package.json').version} | https://git.vdm.dev/joomla/uikit | (c) 2020 - ${new Date().getFullYear()} Llewellyn van der Merwe | MIT License */`
|
2020-09-04 17:45:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const licenseHeader = {
|
|
|
|
banner: `/**
|
2024-09-14 15:47:32 +00:00
|
|
|
* VDM Uikit v${require('./package.json').version}
|
2020-09-04 17:45:23 +00:00
|
|
|
* https://git.vdm.dev/joomla/uikit
|
|
|
|
* (c) 2020 - ${new Date().getFullYear()} Llewellyn van der Merwe
|
|
|
|
* MIT License
|
|
|
|
**/
|
|
|
|
`};
|
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
2024-09-14 15:47:32 +00:00
|
|
|
input: 'src/js/vdm.js',
|
2020-09-04 17:45:23 +00:00
|
|
|
plugins: [
|
|
|
|
license(licenseHeader),
|
|
|
|
replace({
|
|
|
|
'process.env.DEBUG': true,
|
|
|
|
preventAssignment: true,
|
|
|
|
}),
|
|
|
|
resolve(), // Resolves local and node modules
|
|
|
|
commonjs()
|
|
|
|
],
|
|
|
|
output: {
|
2024-09-14 15:47:32 +00:00
|
|
|
file: 'dist/js/vdm.js',
|
2020-09-04 17:45:23 +00:00
|
|
|
format: 'iife',
|
2024-09-14 15:47:32 +00:00
|
|
|
name: 'VDMUikit',
|
2020-09-04 17:45:23 +00:00
|
|
|
globals: {
|
2024-09-14 15:47:32 +00:00
|
|
|
uikit: 'UIkit'
|
2020-09-04 17:45:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
external: ['uikit'], // UIkit is treated as external
|
|
|
|
},
|
|
|
|
{
|
2024-09-14 15:47:32 +00:00
|
|
|
input: 'src/js/vdm.js',
|
2020-09-04 17:45:23 +00:00
|
|
|
plugins: [
|
|
|
|
resolve(), // Resolves local and node modules
|
|
|
|
commonjs(),
|
|
|
|
babel({
|
|
|
|
babelHelpers: 'bundled',
|
|
|
|
presets: ['@babel/preset-env'],
|
|
|
|
}),
|
|
|
|
terser(), // Minify the output
|
|
|
|
license(licenseLine),
|
|
|
|
replace({
|
|
|
|
'process.env.DEBUG': false,
|
|
|
|
preventAssignment: true,
|
|
|
|
})
|
|
|
|
],
|
|
|
|
external: ['uikit'], // UIkit is treated as external
|
|
|
|
output: {
|
2024-09-14 15:47:32 +00:00
|
|
|
file: 'dist/js/vdm.min.js',
|
2020-09-04 17:45:23 +00:00
|
|
|
format: 'iife',
|
2024-09-14 15:47:32 +00:00
|
|
|
name: 'VDMUikit',
|
2020-09-04 17:45:23 +00:00
|
|
|
globals: {
|
2024-09-14 15:47:32 +00:00
|
|
|
uikit: 'UIkit'
|
2020-09-04 17:45:23 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|