File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import resolve from 'rollup-plugin-node-resolve' ;
33import commonjs from 'rollup-plugin-commonjs' ;
44import pkg from './package.json' ;
5+ import fs from 'fs' ;
6+
7+ function license ( filename ) {
8+ filename = filename || './LICENSE' ;
9+ var data = fs . readFileSync ( filename ) . toString ( ) ;
10+ console . log ( data ) ;
11+ console . log ( typeof data ) ;
12+ data = '/**\n * @license\n * ' + data . trim ( ) . replace ( / \n / g, '\n * ' ) + '\n */\n' ;
13+ return { banner : data } ;
14+ }
515
616export default [
717 // Bundled builds.
@@ -17,7 +27,8 @@ export default [
1727 } ,
1828 plugins : [
1929 resolve ( ) ,
20- commonjs ( )
30+ commonjs ( ) ,
31+ license ( './LICENSE' )
2132 ]
2233 } ,
2334 // Un-bundled builds.
@@ -40,7 +51,8 @@ export default [
4051 } ,
4152 plugins : [
4253 resolve ( ) ,
43- commonjs ( )
54+ commonjs ( ) ,
55+ license ( './LICENSE' )
4456 ]
4557 }
4658] ;
You can’t perform that action at this time.
0 commit comments