webpack.prod.config.js 824 B

123456789101112131415161718192021222324252627
  1. const merge = require('webpack-merge').default;
  2. const config = require('./webpack.config');
  3. const LicenseWebpackPlugin = require('license-webpack-plugin')
  4. .LicenseWebpackPlugin;
  5. config[0] = merge(config[0], {
  6. mode: 'production',
  7. devtool: 'source-map',
  8. output: {
  9. // Add version argument when in production so the Jupyter server
  10. // allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files)
  11. filename: '[name].[contenthash].js?v=[contenthash]'
  12. },
  13. optimization: {
  14. minimize: false
  15. },
  16. plugins: [
  17. new LicenseWebpackPlugin({
  18. perChunkOutput: false,
  19. outputFilename: 'third-party-licenses.txt',
  20. excludedPackageTest: packageName =>
  21. packageName === '@jupyterlab/application-top'
  22. })
  23. ]
  24. });
  25. module.exports = config;