Skip to content

Commit

Permalink
fix(tmp): temporary
Browse files Browse the repository at this point in the history
temporary
  • Loading branch information
joannacirillo committed Jul 1, 2022
1 parent f5cf76c commit dd0ad9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"rollup-plugin-string": "3.0.0",
"rollup-plugin-svgo": "1.1.0",
"rollup-plugin-web-worker-loader": "1.6.1",
"rollup-plugin-license": "2.8.1",
"semantic-release": "19.0.3",
"string-replace-loader": "3.1.0",
"style-loader": "3.3.1",
Expand Down
15 changes: 9 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import postcss from 'rollup-plugin-postcss';
import { string } from 'rollup-plugin-string';
import svgo from 'rollup-plugin-svgo';
import webworkerLoader from 'rollup-plugin-web-worker-loader';
import license from 'rollup-plugin-license';
import copy from 'rollup-plugin-copy';

import pkgJSON from './package.json';
Expand Down Expand Up @@ -258,18 +259,20 @@ export default [
file: path.join(outputDir, 'vtk.js'),
format: 'es',
hoistTransitiveImports: false,
intro() {
return `/*! ${fs.readFileSync(
path.resolve(__dirname, './LICENSE'),
'utf8'
)} */`;
},
},
external: [
...dependencies.map((name) => new RegExp(`^${name}`)),
...peerDependencies.map((name) => new RegExp(`^${name}`)),
],
plugins: [
license({
banner: {
commentStyle: 'ignored',
content: {
file: path.join(__dirname, 'LICENSE'),
},
},
}),
alias({
entries: [{ find: 'vtk.js', replacement: path.resolve(__dirname) }],
}),
Expand Down
9 changes: 7 additions & 2 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ function configureOptimization() {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions:{
output:{
comments: /@license/i
}
},
exclude: [
// do not minify Sources/ and Utilities/ dirs
/Sources\//,
Expand All @@ -48,7 +53,7 @@ module.exports = [
optimization: configureOptimization(),
plugins: [
new webpack.BannerPlugin(
`/* ${fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8')} */`
`@license\n ${fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8')}`
),
new webpack.optimize.ModuleConcatenationPlugin(),
new BundleAnalyzerPlugin(configureBundleAnalyzer('vtk')),
Expand All @@ -60,7 +65,7 @@ module.exports = [
optimization: configureOptimization(),
plugins: [
new webpack.BannerPlugin(
`/*! ${fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8')} */`
`@license\n ${fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8')}`
),
new webpack.optimize.ModuleConcatenationPlugin(),
new BundleAnalyzerPlugin(configureBundleAnalyzer('vtk-lite')),
Expand Down

0 comments on commit dd0ad9a

Please sign in to comment.