mirror of
https://github.com/The-Low-Code-Foundation/OpenNoodl.git
synced 2026-01-12 15:22:55 +01:00
Updated project to React 19
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user