*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects

Update module to work with InvenioRDM v11

Merged Moser, Maximilian requested to merge mm/inveniordm-v11 into master
Files
18
/*
/*
* This file is part of Invenio.
* This file is part of Invenio.
* Copyright (C) 2017-2018 CERN.
* Copyright (C) 2017-2018 CERN.
* Copyright (C) 2021 TU Wien.
* Copyright (C) 2022 Graz University of Technology.
 
* Copyright (C) 2021-2023 TU Wien.
*
*
* Invenio is free software; you can redistribute it and/or modify it
* Invenio is free software; you can redistribute it and/or modify it
* under the terms of the MIT License; see LICENSE file for more details.
* under the terms of the MIT License; see LICENSE file for more details.
@@ -17,6 +18,7 @@ const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
@@ -17,6 +18,7 @@ const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const safePostCssParser = require("postcss-safe-parser");
const safePostCssParser = require("postcss-safe-parser");
const TerserPlugin = require("terser-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const webpack = require("webpack");
const webpack = require("webpack");
 
const ESLintPlugin = require("eslint-webpack-plugin");
// Load aliases from config and resolve their full path
// Load aliases from config and resolve their full path
let aliases = {};
let aliases = {};
@@ -131,29 +133,20 @@ var webpackConfig = {
@@ -131,29 +133,20 @@ var webpackConfig = {
},
},
],
],
},
},
{
test: /\.(js|jsx)$/,
enforce: "pre",
exclude: /node_modules/,
use: [
{
options: {
emitWarning: true,
quiet: true,
formatter: require("eslint-friendly-formatter"),
eslintPath: require.resolve("eslint"),
},
loader: require.resolve("eslint-loader"),
},
],
},
{
{
test: /\.(scss|css)$/,
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
},
{
{
test: /\.(less)$/,
test: /\.(less)$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "less-loader"],
use: [
 
MiniCssExtractPlugin.loader,
 
"css-loader",
 
{
 
loader: "less-loader",
 
options: { lessOptions: { math: "always" } },
 
},
 
],
},
},
// Inline images smaller than 10k
// Inline images smaller than 10k
{
{
@@ -186,6 +179,12 @@ var webpackConfig = {
@@ -186,6 +179,12 @@ var webpackConfig = {
devtool:
devtool:
process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map",
process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map",
plugins: [
plugins: [
 
new ESLintPlugin({
 
emitWarning: true,
 
quiet: true,
 
formatter: require("eslint-friendly-formatter"),
 
eslintPath: require.resolve("eslint"),
 
}),
// Pragmas
// Pragmas
new webpack.DefinePlugin({
new webpack.DefinePlugin({
"process.env": process.env.NODE_ENV,
"process.env": process.env.NODE_ENV,
@@ -198,7 +197,10 @@ var webpackConfig = {
@@ -198,7 +197,10 @@ var webpackConfig = {
}),
}),
// Removes the dist folder before each run.
// Removes the dist folder before each run.
new CleanWebpackPlugin({
new CleanWebpackPlugin({
 
dry: false,
 
verbose: false,
dangerouslyAllowCleanPatternsOutsideProject: true,
dangerouslyAllowCleanPatternsOutsideProject: true,
 
cleanStaleWebpackAssets: process.env.NODE_ENV === "production", // keep stale assets in dev because of OS issues
}),
}),
// Automatically inject jquery
// Automatically inject jquery
new webpack.ProvidePlugin({
new webpack.ProvidePlugin({
@@ -210,7 +212,7 @@ var webpackConfig = {
@@ -210,7 +212,7 @@ var webpackConfig = {
// Write manifest file which Python will read.
// Write manifest file which Python will read.
new BundleTracker({
new BundleTracker({
path: config.build.assetsPath,
path: config.build.assetsPath,
filename: path.join(config.build.assetsPath, "manifest.json") ,
filename: path.join(config.build.assetsPath, "manifest.json"),
publicPath: config.build.assetsURL,
publicPath: config.build.assetsURL,
}),
}),
],
],
@@ -218,8 +220,8 @@ var webpackConfig = {
@@ -218,8 +220,8 @@ var webpackConfig = {
};
};
if (process.env.npm_config_report) {
if (process.env.npm_config_report) {
var BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
var BundleAnalyzerPlugin =
.BundleAnalyzerPlugin;
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
}
}
Loading