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:
@@ -3,38 +3,35 @@ const { merge } = require('webpack-merge');
|
||||
const { outPath } = require('./constants.js');
|
||||
const common = require('./webpack.common.js');
|
||||
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const noodlEditorExternalDeployPath = path.join(outPath, 'deploy');
|
||||
|
||||
function stripStartDirectories(targetPath, numDirs) {
|
||||
const p = targetPath.split('/');
|
||||
p.splice(0, numDirs);
|
||||
return p.join(path.sep);
|
||||
}
|
||||
|
||||
module.exports = merge(common, {
|
||||
entry: {
|
||||
deploy: './index.deploy.js'
|
||||
},
|
||||
output: {
|
||||
filename: 'noodl.[name].js',
|
||||
path: noodlEditorExternalDeployPath
|
||||
path: noodlEditorExternalDeployPath,
|
||||
clean: true
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(noodlEditorExternalDeployPath, {
|
||||
allowExternal: true
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: 'static/shared/**/*',
|
||||
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
},
|
||||
{
|
||||
from: 'static/deploy/**/*',
|
||||
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
}
|
||||
])
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: 'static/shared',
|
||||
to: '.',
|
||||
noErrorOnMissing: true,
|
||||
info: { minimized: true }
|
||||
},
|
||||
{
|
||||
from: 'static/deploy',
|
||||
to: '.',
|
||||
noErrorOnMissing: true,
|
||||
info: { minimized: true }
|
||||
}
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,39 +1,30 @@
|
||||
const path = require('path');
|
||||
const { outPath } = require('./constants.js');
|
||||
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const noodlEditorExternalDeployPath = path.join(outPath, 'ssr');
|
||||
|
||||
function stripStartDirectories(targetPath, numDirs) {
|
||||
const p = targetPath.split('/');
|
||||
p.splice(0, numDirs);
|
||||
return p.join(path.sep);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
deploy: './index.ssr.js'
|
||||
},
|
||||
output: {
|
||||
filename: 'noodl.[name].js',
|
||||
path: noodlEditorExternalDeployPath
|
||||
path: noodlEditorExternalDeployPath,
|
||||
clean: true
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(noodlEditorExternalDeployPath, {
|
||||
allowExternal: true
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
// {
|
||||
// from: 'static/shared/**/*',
|
||||
// transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
// },
|
||||
{
|
||||
from: 'static/ssr/**/*',
|
||||
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
}
|
||||
])
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: 'static/ssr',
|
||||
to: '.',
|
||||
noErrorOnMissing: true,
|
||||
info: { minimized: true }
|
||||
}
|
||||
]
|
||||
})
|
||||
],
|
||||
externals: {
|
||||
react: 'React',
|
||||
|
||||
@@ -5,38 +5,35 @@ const { merge } = require('webpack-merge');
|
||||
const { outPath } = require('./constants.js');
|
||||
const common = require('./webpack.common.js');
|
||||
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const noodlEditorExternalViewerPath = path.join(outPath, 'viewer');
|
||||
|
||||
function stripStartDirectories(targetPath, numDirs) {
|
||||
const p = targetPath.split('/');
|
||||
p.splice(0, numDirs);
|
||||
return p.join(path.sep);
|
||||
}
|
||||
|
||||
module.exports = merge(common, {
|
||||
entry: {
|
||||
viewer: './index.viewer.js'
|
||||
},
|
||||
output: {
|
||||
filename: 'noodl.[name].js',
|
||||
path: noodlEditorExternalViewerPath
|
||||
path: noodlEditorExternalViewerPath,
|
||||
clean: true
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(noodlEditorExternalViewerPath, {
|
||||
allowExternal: true
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: 'static/shared/**/*',
|
||||
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
},
|
||||
{
|
||||
from: 'static/viewer/**/*',
|
||||
transformPath: (targetPath) => stripStartDirectories(targetPath, 2)
|
||||
}
|
||||
])
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: 'static/shared',
|
||||
to: '.',
|
||||
noErrorOnMissing: true,
|
||||
info: { minimized: true }
|
||||
},
|
||||
{
|
||||
from: 'static/viewer',
|
||||
to: '.',
|
||||
noErrorOnMissing: true,
|
||||
info: { minimized: true }
|
||||
}
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user