Updated project to React 19

This commit is contained in:
Richard Osborne
2025-12-07 17:32:53 +01:00
parent 2153baf627
commit 8fed72d025
70 changed files with 4534 additions and 5309 deletions

View File

@@ -6,18 +6,11 @@ const { outPath, runtimeVersion } = require('./constants.js');
const common = require('./webpack.common.js');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const GenerateJsonPlugin = require('generate-json-webpack-plugin');
const noodlEditorExternalViewerPath = path.join(outPath, 'cloudruntime');
function stripStartDirectories(targetPath, numDirs) {
const p = targetPath.split('/');
p.splice(0, numDirs);
return p.join(path.sep);
}
const prefix = `const { ipcRenderer } = require('electron'); const _noodl_cloud_runtime_version = "${runtimeVersion}";`;
module.exports = merge(common, {
@@ -26,22 +19,23 @@ module.exports = merge(common, {
},
output: {
filename: 'sandbox.viewer.bundle.js',
path: noodlEditorExternalViewerPath
path: noodlEditorExternalViewerPath,
clean: true
},
plugins: [
new webpack.BannerPlugin({
banner: prefix,
raw: true
}),
new CleanWebpackPlugin(noodlEditorExternalViewerPath, {
allowExternal: true
new CopyWebpackPlugin({
patterns: [
{
from: 'static/viewer',
to: '.',
noErrorOnMissing: true
}
]
}),
new CopyWebpackPlugin([
{
from: 'static/viewer/**/*',
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
}
]),
new GenerateJsonPlugin('manifest.json', {
version: runtimeVersion
})