Skip to content

Commit dd0ad9a

Browse files
committed
fix(tmp): temporary
temporary
1 parent f5cf76c commit dd0ad9a

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
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",

rollup.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import postcss from 'rollup-plugin-postcss';
1515
import { string } from 'rollup-plugin-string';
1616
import svgo from 'rollup-plugin-svgo';
1717
import webworkerLoader from 'rollup-plugin-web-worker-loader';
18+
import license from 'rollup-plugin-license';
1819
import copy from 'rollup-plugin-copy';
1920

2021
import 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
}),

webpack.prod.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ function configureOptimization() {
2929
minimize: true,
3030
minimizer: [
3131
new TerserPlugin({
32+
terserOptions:{
33+
output:{
34+
comments: /@license/i
35+
}
36+
},
3237
exclude: [
3338
// do not minify Sources/ and Utilities/ dirs
3439
/Sources\//,
@@ -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')),

0 commit comments

Comments
 (0)