File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 112112 "rollup-plugin-string" : " 3.0.0" ,
113113 "rollup-plugin-svgo" : " 1.1.0" ,
114114 "rollup-plugin-web-worker-loader" : " 1.6.1" ,
115+ "rollup-plugin-license" : " 2.8.1" ,
115116 "semantic-release" : " 19.0.3" ,
116117 "string-replace-loader" : " 3.1.0" ,
117118 "style-loader" : " 3.3.1" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import postcss from 'rollup-plugin-postcss';
1515import { string } from 'rollup-plugin-string' ;
1616import svgo from 'rollup-plugin-svgo' ;
1717import webworkerLoader from 'rollup-plugin-web-worker-loader' ;
18+ import license from 'rollup-plugin-license' ;
1819import copy from 'rollup-plugin-copy' ;
1920
2021import pkgJSON from './package.json' ;
@@ -258,18 +259,20 @@ export default [
258259 file : path . join ( outputDir , 'vtk.js' ) ,
259260 format : 'es' ,
260261 hoistTransitiveImports : false ,
261- intro ( ) {
262- return `/*! ${ fs . readFileSync (
263- path . resolve ( __dirname , './LICENSE' ) ,
264- 'utf8'
265- ) } */`;
266- } ,
267262 } ,
268263 external : [
269264 ...dependencies . map ( ( name ) => new RegExp ( `^${ name } ` ) ) ,
270265 ...peerDependencies . map ( ( name ) => new RegExp ( `^${ name } ` ) ) ,
271266 ] ,
272267 plugins : [
268+ license ( {
269+ banner : {
270+ commentStyle : 'ignored' ,
271+ content : {
272+ file : path . join ( __dirname , 'LICENSE' ) ,
273+ } ,
274+ } ,
275+ } ) ,
273276 alias ( {
274277 entries : [ { find : 'vtk.js' , replacement : path . resolve ( __dirname ) } ] ,
275278 } ) ,
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ function configureOptimization() {
2929 minimize : true ,
3030 minimizer : [
3131 new TerserPlugin ( {
32+ terserOptions :{
33+ output :{
34+ comments : / @ l i c e n s e / i
35+ }
36+ } ,
3237 exclude : [
3338 // do not minify Sources/ and Utilities/ dirs
3439 / S o u r c e s \/ / ,
@@ -48,7 +53,7 @@ module.exports = [
4853 optimization : configureOptimization ( ) ,
4954 plugins : [
5055 new webpack . BannerPlugin (
51- `/* ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } */ `
56+ `@license\n ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } `
5257 ) ,
5358 new webpack . optimize . ModuleConcatenationPlugin ( ) ,
5459 new BundleAnalyzerPlugin ( configureBundleAnalyzer ( 'vtk' ) ) ,
@@ -60,7 +65,7 @@ module.exports = [
6065 optimization : configureOptimization ( ) ,
6166 plugins : [
6267 new webpack . BannerPlugin (
63- `/*! ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } */ `
68+ `@license\n ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } `
6469 ) ,
6570 new webpack . optimize . ModuleConcatenationPlugin ( ) ,
6671 new BundleAnalyzerPlugin ( configureBundleAnalyzer ( 'vtk-lite' ) ) ,
You can’t perform that action at this time.
0 commit comments