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

Skip to content
Snippets Groups Projects
Commit aa11f921 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Remove the custom build projects

* it was a fun ride, but with the new and improved `rspack`-based build
  project being shipped with Invenio-Assets, there's no real reason why
  we'd keep our custom override anymore
parent 194d48d4
No related branches found
No related tags found
1 merge request!180Remove the custom build projects
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
build/*.js
/*
* This file is part of Invenio.
* Copyright (C) 2017-2018 CERN.
*
* 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.
*/
module.exports = {
root: true,
parser: "@babel/eslint-parser",
parserOptions: {
sourceType: "module",
requireConfigFile: false,
},
env: {
browser: true,
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: ["react-app", "plugin:jsx-a11y/recommended"],
plugins: ["jsx-a11y"],
// add your custom rules here
rules: {
// allow paren-less arrow functions
"arrow-parens": 0,
// allow async-await
"generator-star-spacing": 0,
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
},
};
# required for pnpm to work with webpack
# https://github.com/webpack/webpack/issues/5087#issuecomment-1589749984
node-linker=hoisted
shamefully-hoist=true
/*
* This file is part of Invenio.
* Copyright (C) 2017-2018 CERN.
* Copyright (C) 2022-2023 Graz University of Technology.
* Copyright (C) 2023-2025 TU Wien.
*
* 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.
*/
// https://birtles.blog/2024/08/14/lessons-learned-switching-to-rspack/
const BundleTracker = require("webpack-bundle-tracker");
const config = require("./config");
const path = require("path");
// Use rspack
const rspack = require("@rspack/core");
// Load aliases from config and resolve their full path
let aliases = {};
if (config.aliases) {
aliases = Object.fromEntries(
Object.entries(config.aliases).map(([alias, alias_path]) => [
alias,
path.resolve(config.build.context, alias_path),
]),
);
}
// Create copy patterns from config
let copyPatterns = [];
if (config.copy) {
for (const copy of config.copy) {
const copyPattern = {
from: path.resolve(__dirname, copy.from),
to: path.resolve(__dirname, copy.to),
};
copyPatterns.push(copyPattern);
}
}
const prod = process.env.NODE_ENV === "production";
const webpackConfig = {
mode: process.env.NODE_ENV,
entry: config.entry,
context: config.build.context,
stats: {
//preset: 'verbose',
warnings: true,
errors: true,
errorsCount: true,
errorStack: true,
errorDetails: true,
children: true,
},
resolve: {
extensions: ["*", ".js", ".jsx"],
symlinks: false,
alias: aliases,
fallback: {
zlib: require.resolve("browserify-zlib"),
stream: require.resolve("stream-browserify"),
https: require.resolve("https-browserify"),
http: require.resolve("stream-http"),
url: false,
assert: false,
},
},
output: {
clean: true, // replaces CleanWebpackPlugin
path: config.build.assetsPath,
filename: "js/[name].[chunkhash].js",
chunkFilename: "js/[id].[chunkhash].js",
publicPath: config.build.assetsURL,
},
optimization: {
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
compress: {
ecma: 5,
// warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
// Pending further investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
mangle: {
safari10: true,
},
}),
// would be nice, but not workable at the moment, no idea why
new rspack.LightningCssMinimizerRspackPlugin({
minimizerOptions: {
targets: [
"last 2 Chrome versions",
"Firefox ESR",
"last 2 Safari versions",
],
},
}),
],
splitChunks: {
chunks: "all",
},
// Extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated.
runtimeChunk: {
name: "manifest",
},
},
module: {
rules: [
{
test: require.resolve("jquery"),
use: [
{
loader: "expose-loader",
options: {
exposes: ["$", "jQuery"],
},
},
],
},
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/, /@babel(?:\/|\\{1,2})runtime/],
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "ecmascript",
jsx: true,
},
externalHelpers: true,
transform: {
react: {
development: !prod,
useBuiltins: true,
},
},
},
env: {
targets: "Chrome >= 48",
},
},
},
{
test: /\.(scss|css)$/,
use: [
rspack.CssExtractRspackPlugin.loader,
"css-loader",
"sass-loader",
],
},
{
test: /\.(less)$/,
use: [
rspack.CssExtractRspackPlugin.loader,
"css-loader",
"less-loader",
],
},
// Rspack
// Inline images smaller than 10k
{
test: /\.(avif|webp|png|jpe?g|gif|svg)(\?.*)?$/,
type: "asset/resource",
},
// no mimetype for ".cur" in mimetype database, specify it with `generator`
{
test: /\.(cur)(\?.*)?$/,
type: "asset/inline",
generator: {
dataUrl: {
encoding: "base64",
mimetype: "image/x-icon",
},
},
},
// Inline webfonts smaller than 10k
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
type: "asset/resource",
generator: {
filename: "fonts/[name].[contenthash:7].[ext]",
},
},
],
},
devtool:
process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map",
plugins: [
new rspack.DefinePlugin({
"process.env": process.env.NODE_ENV,
}),
new rspack.CssExtractRspackPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "css/[name].[contenthash].css",
chunkFilename: "css/[name].[contenthash].css",
}),
// Copying relevant CSS files as TinyMCE tries to import css files from the dist/js folder of static files
new rspack.CopyRspackPlugin({
patterns: copyPatterns,
}),
// Automatically inject jquery
new rspack.ProvidePlugin({
jQuery: "jquery",
$: "jquery",
jquery: "jquery",
"window.jQuery": "jquery",
}),
// Write manifest file which Python will read.
new BundleTracker({
path: config.build.assetsPath,
filename: path.join(config.build.assetsPath, "manifest.json"),
publicPath: config.build.assetsURL,
}),
],
performance: { hints: false },
watchOptions: {
followSymlinks: true,
},
experiments: {
css: false,
},
devServer: {
hot: true, // Enable Hot Module Replacement (HMR)
liveReload: true, // Enable live reload
},
};
if (process.env.npm_config_report) {
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
}
module.exports = webpackConfig;
/*
* This file is part of Invenio.
* Copyright (C) 2017-2018 CERN.
* Copyright (C) 2022-2023 Graz University of Technology.
* Copyright (C) 2021-2024 TU Wien.
*
* 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.
*/
const BundleTracker = require("webpack-bundle-tracker");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const ESLintPlugin = require("eslint-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const config = require("./config");
const path = require("node:path");
const webpack = require("webpack");
// Load aliases from config and resolve their full path
let aliases = {};
if (config.aliases) {
aliases = Object.fromEntries(
Object.entries(config.aliases).map(([alias, alias_path]) => [
alias,
path.resolve(config.build.context, alias_path),
]),
);
}
// Create copy patterns from config
let copyPatterns = [];
if (config.copy) {
for (const copy of config.copy) {
const copyPattern = {
from: path.resolve(__dirname, copy.from),
to: path.resolve(__dirname, copy.to),
};
copyPatterns.push(copyPattern);
}
}
const webpackConfig = {
mode: process.env.NODE_ENV,
entry: config.entry,
context: config.build.context,
stats: {
warnings: true,
errors: true,
errorsCount: true,
errorStack: true,
errorDetails: true,
children: true,
},
resolve: {
extensions: ["*", ".js", ".jsx"],
symlinks: false,
alias: aliases,
fallback: {
zlib: require.resolve("browserify-zlib"),
stream: require.resolve("stream-browserify"),
https: require.resolve("https-browserify"),
http: require.resolve("stream-http"),
url: false,
assert: false,
},
},
output: {
path: config.build.assetsPath,
filename: "js/[name].[chunkhash].js",
chunkFilename: "js/[id].[chunkhash].js",
publicPath: config.build.assetsURL,
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minification steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
// Pending further investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
mangle: {
safari10: true,
},
output: {
ecma: 5,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
ascii_only: true,
},
},
}),
new CssMinimizerPlugin(),
],
splitChunks: {
chunks: "all",
},
// Extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated.
runtimeChunk: {
name: "manifest",
},
},
module: {
rules: [
{
test: require.resolve("jquery"),
use: [
{
loader: "expose-loader",
options: {
exposes: ["$", "jQuery"],
},
},
],
},
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/, /@babel(?:\/|\\{1,2})runtime/],
use: [
{
loader: "esbuild-loader",
options: {
target: "es2015",
loader: "jsx",
},
},
],
},
{
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
{
test: /\.(less)$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "less-loader",
options: { lessOptions: { math: "always" } },
},
],
},
// Inline images smaller than 10k
{
test: /\.(avif|webp|png|jpe?g|gif|svg)(\?.*)?$/,
type: "asset/inline",
parser: {
dataUrlCondition: {
maxSize: 10 * 1024, // 10kb
},
},
},
// no mimetype for ".cur" in mimetype database, specify it with `generator`
{
test: /\.(cur)(\?.*)?$/,
type: "asset/inline",
generator: {
dataUrl: {
encoding: "base64",
mimetype: "image/x-icon",
},
},
parser: {
dataUrlCondition: {
maxSize: 10 * 1024, // 10kb
},
},
},
// Inline webfonts smaller than 10k
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
type: "asset/resource",
generator: {
filename: "fonts/[name].[contenthash:7].[ext]",
},
parser: {
dataUrlCondition: {
maxSize: 10 * 1024, // 10kb
},
},
},
],
},
devtool:
process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map",
plugins: [
new ESLintPlugin({
emitWarning: true,
quiet: true,
formatter: require("eslint-friendly-formatter"),
eslintPath: require.resolve("eslint"),
}),
// Pragmas
new webpack.DefinePlugin({
"process.env": process.env.NODE_ENV,
}),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "css/[name].[contenthash].css",
chunkFilename: "css/[name].[contenthash].css",
}),
// Removes the dist folder before each run.
new CleanWebpackPlugin({
dry: false,
verbose: false,
dangerouslyAllowCleanPatternsOutsideProject: true,
cleanStaleWebpackAssets: process.env.NODE_ENV === "production", // keep stale assets in dev because of OS issues
}),
// Automatically inject jquery
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery",
jquery: "jquery",
"window.jQuery": "jquery",
}),
// Write manifest file which Python will read.
new BundleTracker({
path: config.build.assetsPath,
filename: path.join(config.build.assetsPath, "manifest.json"),
publicPath: config.build.assetsURL,
}),
],
performance: { hints: false },
snapshot: {
managedPaths: [],
},
watchOptions: {
followSymlinks: true,
},
};
// Copying relevant CSS files as e.g. TinyMCE tries to import CSS files from the dist/js folder of static files
// The copy plugin doesn't like being initialized with an empty list of patterns
if (copyPatterns.length > 0) {
const copyPlugin = new CopyWebpackPlugin({ patterns: copyPatterns });
webpackConfig.plugins.push(copyPlugin);
}
if (process.env.npm_config_report) {
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
}
if (process.env.NODE_ENV === "development") {
const LiveReloadPlugin = require("webpack-livereload-plugin");
webpackConfig.plugins.push(new LiveReloadPlugin());
}
module.exports = webpackConfig;
{
"name": "invenio-theme-tuw",
"version": "1.0.0",
"description": "Invenio Theme TUW",
"author": "Center for Research Data Management <centerrdm.team@tuwien.ac.at>",
"private": true,
"scripts": {
"start": "NODE_PRESERVE_SYMLINKS=1 NODE_ENV=development webpack --watch --progress --config ./build/webpack.config.js",
"build": "NODE_PRESERVE_SYMLINKS=1 NODE_ENV=production webpack --config ./build/webpack.config.js",
"postinstall": "patch-package"
},
"dependencies": {
"tinymce": "^6.7.2"
},
"devDependencies": {
"browserify-zlib": "^0.2.0",
"https-browserify": "^1.0.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"patch-package": "^6.5.0",
"@babel/core": "^7.18.0",
"ajv": "^8.12.0",
"@babel/eslint-parser": "^7.18.0",
"@babel/plugin-proposal-class-properties": "^7.18.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.0",
"@babel/plugin-transform-runtime": "^7.18.0",
"@babel/preset-env": "^7.18.0",
"@babel/preset-react": "^7.18.0",
"@babel/register": "^7.18.0",
"@babel/runtime": "^7.18.0",
"@inveniosoftware/eslint-config-invenio": "^2.0.0",
"autoprefixer": "^10.4.0",
"esbuild-loader": "^4.2.0",
"chalk": "^5.0.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.0.0",
"css-minimizer-webpack-plugin": "^4.2.0",
"eslint-config-react-app": "^7.0.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-webpack-plugin": "^2.5.0",
"eventsource-polyfill": "^0.9.0",
"expose-loader": "^4.0.0",
"file-loader": "^6.0.0",
"function-bind": "^1.1.0",
"less": "^4.0.0",
"less-loader": "^11.0.0",
"mini-css-extract-plugin": "^2.0.0",
"ora": "^6.0.0",
"postcss-flexbugs-fixes": "^5.0.0",
"postcss-loader": "^7.0.0",
"postcss-preset-env": "^8.0.0",
"postcss-safe-parser": "^6.0.0",
"prettier": "^2.7.0",
"rimraf": "^4.0.0",
"sass": "^1.50.0",
"sass-loader": "^13.0.0",
"style-loader": "^3.0.0",
"terser-webpack-plugin": "^5.0.0",
"url-loader": "^4.1.0",
"webpack": "^5.0.0",
"webpack-bundle-analyzer": "^4.0.0",
"webpack-bundle-tracker": "^1.0.0",
"webpack-cli": "^5.0.0",
"webpack-dev-middleware": "^6.0.0",
"webpack-hot-middleware": "^2.24.0",
"webpack-livereload-plugin": "^3.0.0",
"webpack-merge": "^5.1.0",
"webpack-yam-plugin": "^1.0.0",
"copy-webpack-plugin": "^11.0.0"
},
"engines": {
"node": ">= 18",
"npm": ">= 8"
}
}
diff --git a/node_modules/semantic-ui-less/themes/default/collections/message.variables b/node_modules/semantic-ui-less/themes/default/collections/message.variables
index 10d7f98..a596ffa 100644
--- a/node_modules/semantic-ui-less/themes/default/collections/message.variables
+++ b/node_modules/semantic-ui-less/themes/default/collections/message.variables
@@ -36,7 +36,7 @@
@headerFontWeight: @bold;
@headerDisplay: block;
@headerDistance: 0rem;
-@headerMargin: -@headerLineHeightOffset 0em @headerDistance 0em;
+@headerMargin: (-@headerLineHeightOffset) 0em @headerDistance 0em;
@headerParagraphDistance: 0.25em;
/* Paragraph */
diff --git a/node_modules/semantic-ui-less/themes/default/elements/header.variables b/node_modules/semantic-ui-less/themes/default/elements/header.variables
index 885715b..58699eb 100644
--- a/node_modules/semantic-ui-less/themes/default/elements/header.variables
+++ b/node_modules/semantic-ui-less/themes/default/elements/header.variables
@@ -16,7 +16,7 @@
@bottomMargin: @headerBottomMargin;
@margin: @topMargin 0em @bottomMargin;
-@firstMargin: -@lineHeightOffset;
+@firstMargin: (-@lineHeightOffset);
@lastMargin: 0em;
@horizontalPadding: 0em;
@verticalPadding: 0em;
diff --git a/node_modules/semantic-ui-less/themes/default/globals/site.variables b/node_modules/semantic-ui-less/themes/default/globals/site.variables
index f297aef..39f2555 100755
--- a/node_modules/semantic-ui-less/themes/default/globals/site.variables
+++ b/node_modules/semantic-ui-less/themes/default/globals/site.variables
@@ -390,34 +390,34 @@
This rounds @size values to the closest pixel then expresses that value in (r)em.
This ensures all size values round to exact pixels
*/
-@mini : unit( round(@miniSize * @emSize) / @emSize, rem);
-@tiny : unit( round(@tinySize * @emSize) / @emSize, rem);
-@small : unit( round(@smallSize * @emSize) / @emSize, rem);
-@medium : unit( round(@mediumSize * @emSize) / @emSize, rem);
-@large : unit( round(@largeSize * @emSize) / @emSize, rem);
-@big : unit( round(@bigSize * @emSize) / @emSize, rem);
-@huge : unit( round(@hugeSize * @emSize) / @emSize, rem);
-@massive : unit( round(@massiveSize * @emSize) / @emSize, rem);
+@mini : unit( (round(@miniSize * @emSize) / @emSize), rem);
+@tiny : unit( (round(@tinySize * @emSize) / @emSize), rem);
+@small : unit( (round(@smallSize * @emSize) / @emSize), rem);
+@medium : unit( (round(@mediumSize * @emSize) / @emSize), rem);
+@large : unit( (round(@largeSize * @emSize) / @emSize), rem);
+@big : unit( (round(@bigSize * @emSize) / @emSize), rem);
+@huge : unit( (round(@hugeSize * @emSize) / @emSize), rem);
+@massive : unit( (round(@massiveSize * @emSize) / @emSize), rem);
/* em */
-@relativeMini : unit( round(@miniSize * @emSize) / @emSize, em);
-@relativeTiny : unit( round(@tinySize * @emSize) / @emSize, em);
-@relativeSmall : unit( round(@smallSize * @emSize) / @emSize, em);
-@relativeMedium : unit( round(@mediumSize * @emSize) / @emSize, em);
-@relativeLarge : unit( round(@largeSize * @emSize) / @emSize, em);
-@relativeBig : unit( round(@bigSize * @emSize) / @emSize, em);
-@relativeHuge : unit( round(@hugeSize * @emSize) / @emSize, em);
-@relativeMassive : unit( round(@massiveSize * @emSize) / @emSize, em);
+@relativeMini : unit( (round(@miniSize * @emSize) / @emSize), em);
+@relativeTiny : unit( (round(@tinySize * @emSize) / @emSize), em);
+@relativeSmall : unit( (round(@smallSize * @emSize) / @emSize), em);
+@relativeMedium : unit( (round(@mediumSize * @emSize) / @emSize), em);
+@relativeLarge : unit( (round(@largeSize * @emSize) / @emSize), em);
+@relativeBig : unit( (round(@bigSize * @emSize) / @emSize), em);
+@relativeHuge : unit( (round(@hugeSize * @emSize) / @emSize), em);
+@relativeMassive : unit( (round(@massiveSize * @emSize) / @emSize), em);
/* rem */
-@absoluteMini : unit( round(@miniSize * @emSize) / @emSize, rem);
-@absoluteTiny : unit( round(@tinySize * @emSize) / @emSize, rem);
-@absoluteSmall : unit( round(@smallSize * @emSize) / @emSize, rem);
-@absoluteMedium : unit( round(@mediumSize * @emSize) / @emSize, rem);
-@absoluteLarge : unit( round(@largeSize * @emSize) / @emSize, rem);
-@absoluteBig : unit( round(@bigSize * @emSize) / @emSize, rem);
-@absoluteHuge : unit( round(@hugeSize * @emSize) / @emSize, rem);
-@absoluteMassive : unit( round(@massiveSize * @emSize) / @emSize, rem);
+@absoluteMini : unit( (round(@miniSize * @emSize) / @emSize), rem);
+@absoluteTiny : unit( (round(@tinySize * @emSize) / @emSize), rem);
+@absoluteSmall : unit( (round(@smallSize * @emSize) / @emSize), rem);
+@absoluteMedium : unit( (round(@mediumSize * @emSize) / @emSize), rem);
+@absoluteLarge : unit( (round(@largeSize * @emSize) / @emSize), rem);
+@absoluteBig : unit( (round(@bigSize * @emSize) / @emSize), rem);
+@absoluteHuge : unit( (round(@hugeSize * @emSize) / @emSize), rem);
+@absoluteMassive : unit( (round(@massiveSize * @emSize) / @emSize), rem);
/*-------------------
Icons
diff --git a/node_modules/semantic-ui-less/themes/default/modules/search.variables b/node_modules/semantic-ui-less/themes/default/modules/search.variables
index 362bc13..e6668d5 100644
--- a/node_modules/semantic-ui-less/themes/default/modules/search.variables
+++ b/node_modules/semantic-ui-less/themes/default/modules/search.variables
@@ -51,7 +51,7 @@
/* Result Content */
@resultTitleFont: @headerFont;
-@resultTitleMargin: -@headerLineHeightOffset 0em 0em;
+@resultTitleMargin: (-@headerLineHeightOffset) 0em 0em;
@resultTitleFontWeight: @bold;
@resultTitleFontSize: @relativeMedium;
@resultTitleColor: @darkTextColor;
{
"name": "invenio-assets",
"version": "2.0.0",
"description": "Invenio assets",
"author": "CERN <info@inveniosoftware.org>",
"private": true,
"scripts": {
"start": "NODE_PRESERVE_SYMLINKS=1 rspack --mode development --watch --config ./build/rspack.config.js",
"build": "NODE_PRESERVE_SYMLINKS=1 rspack --mode production --config ./build/rspack.config.js",
"postinstall": "patch-package"
},
"dependencies": {
"tinymce": "^6.7.2"
},
"devDependencies": {
"@rspack/cli": ">1.0.0",
"@rspack/core": ">1.0.0",
"@rspack/dev-server": ">1.0.0",
"@swc/core": "^1.6.13",
"@swc/helpers": "^0.5.11",
"sass-loader": "^16.0.0",
"swc-loader": "^0.2.6",
"@babel/core": "^7.18.0",
"@babel/eslint-parser": "^7.18.0",
"@babel/plugin-proposal-class-properties": "^7.18.0",
"@babel/plugin-transform-runtime": "^7.18.0",
"@babel/preset-env": "^7.18.0",
"@babel/preset-react": "^7.18.0",
"@babel/register": "^7.18.0",
"@babel/runtime": "^7.18.0",
"@inveniosoftware/eslint-config-invenio": "^2.0.0",
"ajv": "^8.12.0",
"autoprefixer": "^10.4.0",
"babel-loader": "^9.0.0",
"browserify-zlib": "^0.2.0",
"chalk": "^5.0.0",
"css-loader": "^6.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-webpack-plugin": "^2.5.0",
"eventsource-polyfill": "^0.9.0",
"expose-loader": "^4.0.0",
"file-loader": "^6.0.0",
"function-bind": "^1.1.0",
"https-browserify": "^1.0.0",
"less": "^4.0.0",
"less-loader": "^11.0.0",
"ora": "^6.0.0",
"patch-package": "^6.5.0",
"postcss-flexbugs-fixes": "^5.0.0",
"postcss-loader": "^7.0.0",
"postcss-preset-env": "^8.0.0",
"postcss-safe-parser": "^6.0.0",
"prettier": "^2.7.0",
"rimraf": "^4.0.0",
"sass": "^1.50.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"style-loader": "^3.0.0",
"url-loader": "^4.1.0",
"webpack-bundle-analyzer": "^4.0.0",
"webpack-bundle-tracker": "^1.0.0"
},
"engines": {
"node": ">=18",
"npm": ">=8"
}
}
...@@ -97,7 +97,7 @@ OAUTHCLIENT_LOGIN_USER_TEMPLATE = "invenio_theme_tuw/overrides/login_user.html" ...@@ -97,7 +97,7 @@ OAUTHCLIENT_LOGIN_USER_TEMPLATE = "invenio_theme_tuw/overrides/login_user.html"
# ================ # ================
# See https://flask-webpackext.readthedocs.io/en/latest/configuration.html # See https://flask-webpackext.readthedocs.io/en/latest/configuration.html
WEBPACKEXT_PROJECT = "invenio_theme_tuw.webpack:rspack_project" WEBPACKEXT_PROJECT = "invenio_assets.webpack:rspack_project"
APP_RDM_DETAIL_SIDE_BAR_TEMPLATES = [ APP_RDM_DETAIL_SIDE_BAR_TEMPLATES = [
"invenio_app_rdm/records/details/side_bar/manage_menu.html", "invenio_app_rdm/records/details/side_bar/manage_menu.html",
......
...@@ -7,51 +7,7 @@ ...@@ -7,51 +7,7 @@
"""JS/CSS Webpack bundles for TU Wien theme.""" """JS/CSS Webpack bundles for TU Wien theme."""
from flask_webpackext import WebpackBundleProject as WebpackBundleProjectBase
from invenio_assets.webpack import WebpackThemeBundle from invenio_assets.webpack import WebpackThemeBundle
from pywebpack import bundles_from_entry_point
class WebpackBundleProject(WebpackBundleProjectBase):
"""Flask webpack bundle project."""
def __init__(self, import_name, base_package_json="package.json", **kwargs):
"""Constructor."""
super().__init__(import_name, **kwargs)
self._package_json_source_path = base_package_json
# our override for the frontend build project:
# we override the build configuration (based on the one provided in `invenio-assets`)
# in order to customize its behaviour, e.g. allowing the collection of '*.webp' images.
#
# implementation note, in case you'll need to touch this:
# `project.path` is overridden by the `_PathStorageMixin` in `flask_webpackext` and
# will point to the directory specified by `app.config['WEBPACKEXT_PROJECT_BUILDDIR']`,
# which # will be used as the working directory for `npm`, and also specifies where
# the assets from each module should be copied to.
#
# rough explanation of the arguments:
# * import_name: the import name of the current module, will be used to determine
# the base path where to look for the provided assets/configs
# * project_folder: the sub-directory in which to look for the `package.json`
# * config_path: where to put npm's `config.json` (inside the `project_folder`)
# * bundles: the bundles that should be used for building the frontend
webpack_project = WebpackBundleProject(
import_name=__name__,
project_folder="build_project",
config_path="build/config.json",
bundles=bundles_from_entry_point("invenio_assets.webpack"),
)
project = webpack_project
rspack_project = WebpackBundleProject(
import_name=__name__,
base_package_json="rspack-package.json",
project_folder="build_project",
config_path="build/config.json",
bundles=bundles_from_entry_point("invenio_assets.webpack"),
)
# the definition of our own bundle of frontend assets, which will be collected and # the definition of our own bundle of frontend assets, which will be collected and
# built by `pywebpack`/`flask_webpackext`/`invenio_assets`. # built by `pywebpack`/`flask_webpackext`/`invenio_assets`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment