mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-06 13:50:29 +08:00
* Add webpack config for prod * add optimization * rename top package * Add HtmlWebpackPlugin - rough draft * Move templates and ignore generated html * Use loop to create HtmlWebpackPlugins * Remove bundle.js from ensured-targets --------- Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
30 lines
840 B
JavaScript
30 lines
840 B
JavaScript
/*
|
|
* Copyright (c) Jupyter Development Team.
|
|
* Distributed under the terms of the Modified BSD License.
|
|
*/
|
|
|
|
const merge = require('webpack-merge').default;
|
|
const config = require('./webpack.config');
|
|
const WPPlugin = require('@jupyterlab/builder').WPPlugin;
|
|
|
|
config[0] = merge(config[0], {
|
|
mode: 'production',
|
|
devtool: 'source-map',
|
|
output: {
|
|
// Add version argument when in production so the Jupyter server
|
|
// allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files)
|
|
filename: '[name].[contenthash].js?v=[contenthash]',
|
|
},
|
|
optimization: {
|
|
minimize: false,
|
|
},
|
|
plugins: [
|
|
new WPPlugin.JSONLicenseWebpackPlugin({
|
|
excludedPackageTest: (packageName) =>
|
|
packageName === '@jupyter-notebook/app',
|
|
}),
|
|
],
|
|
});
|
|
|
|
module.exports = config;
|