webpack.prod.config.js 728 B

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