11import terser from '@rollup/plugin-terser' ;
22import babel from '@rollup/plugin-babel' ;
33import { nodeResolve } from '@rollup/plugin-node-resolve' ;
4+ import { readFileSync } from 'fs' ;
5+
6+ const pkg = JSON . parse ( readFileSync ( './package.json' , 'utf8' ) ) ;
7+ const banner = `/*! MicroUI v${ pkg . version } | MIT License | https://github.com/lam0819/microui */` ;
8+
9+ // Simple plugin to replace __VERSION__ with actual version
10+ const replaceVersion = ( ) => ( {
11+ name : 'replace-version' ,
12+ transform ( code ) {
13+ return code . replace ( / _ _ V E R S I O N _ _ / g, pkg . version ) ;
14+ }
15+ } ) ;
416
517export default [
618 // Development build
@@ -10,10 +22,11 @@ export default [
1022 file : 'dist/microui.js' ,
1123 format : 'umd' ,
1224 name : 'MicroUI' ,
13- banner : '/*! MicroUI v1.0.0 | MIT License | https://github.com/lam0819/microui */'
25+ banner
1426 } ,
1527 plugins : [
1628 nodeResolve ( ) ,
29+ replaceVersion ( ) ,
1730 babel ( {
1831 babelHelpers : 'bundled' ,
1932 exclude : 'node_modules/**'
@@ -27,10 +40,11 @@ export default [
2740 file : 'dist/microui.min.js' ,
2841 format : 'umd' ,
2942 name : 'MicroUI' ,
30- banner : '/*! MicroUI v1.0.0 | MIT License | https://github.com/lam0819/microui */'
43+ banner
3144 } ,
3245 plugins : [
3346 nodeResolve ( ) ,
47+ replaceVersion ( ) ,
3448 babel ( {
3549 babelHelpers : 'bundled' ,
3650 exclude : 'node_modules/**'
@@ -48,10 +62,11 @@ export default [
4862 output : {
4963 file : 'dist/microui.esm.js' ,
5064 format : 'es' ,
51- banner : '/*! MicroUI v1.0.0 | MIT License | https://github.com/lam0819/microui */'
65+ banner
5266 } ,
5367 plugins : [
5468 nodeResolve ( ) ,
69+ replaceVersion ( ) ,
5570 babel ( {
5671 babelHelpers : 'bundled' ,
5772 exclude : 'node_modules/**'
0 commit comments