2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-16 09:37:09 +00:00
iconify/plugins/tailwind/rollup.config.mjs

45 lines
908 B
JavaScript
Raw Normal View History

2023-01-11 15:42:21 +00:00
import { readFileSync, writeFileSync } from 'fs';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
// Header
const header = `/**
* (c) Iconify for Tailwind CSS
*
* For the full copyright and license information, please view the license.txt
* files at https://github.com/iconify/iconify
*
* Licensed under MIT.
*
* @license MIT
* @version __iconify_version__
*/`;
// Get replacements
const replacements = {
preventAssignment: true,
};
const packageJSON = JSON.parse(readFileSync('package.json', 'utf8'));
replacements['__iconify_version__'] = packageJSON.version;
// Export configuration
const config = {
input: 'lib/plugin.js',
output: [
{
file: 'dist/plugin.js',
format: 'cjs',
banner: header,
},
],
external: ['tailwindcss/plugin'],
plugins: [
resolve({
browser: true,
}),
replace(replacements),
],
};
export default config;