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 112
112
"rollup-plugin-string" : " 3.0.0" ,
113
113
"rollup-plugin-svgo" : " 1.1.0" ,
114
114
"rollup-plugin-web-worker-loader" : " 1.6.1" ,
115
+ "rollup-plugin-license" : " 2.8.1" ,
115
116
"semantic-release" : " 19.0.3" ,
116
117
"string-replace-loader" : " 3.1.0" ,
117
118
"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';
15
15
import { string } from 'rollup-plugin-string' ;
16
16
import svgo from 'rollup-plugin-svgo' ;
17
17
import webworkerLoader from 'rollup-plugin-web-worker-loader' ;
18
+ import license from 'rollup-plugin-license' ;
18
19
import copy from 'rollup-plugin-copy' ;
19
20
20
21
import pkgJSON from './package.json' ;
@@ -258,18 +259,20 @@ export default [
258
259
file : path . join ( outputDir , 'vtk.js' ) ,
259
260
format : 'es' ,
260
261
hoistTransitiveImports : false ,
261
- intro ( ) {
262
- return `/*! ${ fs . readFileSync (
263
- path . resolve ( __dirname , './LICENSE' ) ,
264
- 'utf8'
265
- ) } */`;
266
- } ,
267
262
} ,
268
263
external : [
269
264
...dependencies . map ( ( name ) => new RegExp ( `^${ name } ` ) ) ,
270
265
...peerDependencies . map ( ( name ) => new RegExp ( `^${ name } ` ) ) ,
271
266
] ,
272
267
plugins : [
268
+ license ( {
269
+ banner : {
270
+ commentStyle : 'ignored' ,
271
+ content : {
272
+ file : path . join ( __dirname , 'LICENSE' ) ,
273
+ } ,
274
+ } ,
275
+ } ) ,
273
276
alias ( {
274
277
entries : [ { find : 'vtk.js' , replacement : path . resolve ( __dirname ) } ] ,
275
278
} ) ,
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ function configureOptimization() {
29
29
minimize : true ,
30
30
minimizer : [
31
31
new TerserPlugin ( {
32
+ terserOptions :{
33
+ output :{
34
+ comments : / @ l i c e n s e / i
35
+ }
36
+ } ,
32
37
exclude : [
33
38
// do not minify Sources/ and Utilities/ dirs
34
39
/ S o u r c e s \/ / ,
@@ -48,7 +53,7 @@ module.exports = [
48
53
optimization : configureOptimization ( ) ,
49
54
plugins : [
50
55
new webpack . BannerPlugin (
51
- `/* ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } */ `
56
+ `@license\n ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } `
52
57
) ,
53
58
new webpack . optimize . ModuleConcatenationPlugin ( ) ,
54
59
new BundleAnalyzerPlugin ( configureBundleAnalyzer ( 'vtk' ) ) ,
@@ -60,7 +65,7 @@ module.exports = [
60
65
optimization : configureOptimization ( ) ,
61
66
plugins : [
62
67
new webpack . BannerPlugin (
63
- `/*! ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } */ `
68
+ `@license\n ${ fs . readFileSync ( path . resolve ( __dirname , './LICENSE' ) , 'utf8' ) } `
64
69
) ,
65
70
new webpack . optimize . ModuleConcatenationPlugin ( ) ,
66
71
new BundleAnalyzerPlugin ( configureBundleAnalyzer ( 'vtk-lite' ) ) ,
You can’t perform that action at this time.
0 commit comments