Skip to content

Commit abeba44

Browse files
authored
Release 15.1.5 (#177)
## What's Changed * feat: add package_json_key setting by @puehringer in #139 **Full Changelog**: v15.1.4...v15.1.5
2 parents 0d8d238 + facfd43 commit abeba44

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

config/rspack.config.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = (webpackEnv, argv) => {
4444
}
4545

4646
const isDevServerOnly = env.dev_server_only?.toLowerCase() === 'true';
47+
const packageJsonKey = env.package_json_key || 'visyn';
4748
const devtool = env.devtool?.toLowerCase() === 'false' ? false : env.devtool || (isEnvDevelopment ? 'eval-source-map' : 'source-map');
4849
const isReactRefresh = isDevServer && isEnvDevelopment;
4950

@@ -55,8 +56,8 @@ module.exports = (webpackEnv, argv) => {
5556
// Always look for the phovea_registry.ts in the src folder for standalone repos.
5657
const workspaceRegistryFile = path.join(workspacePath, 'src/phovea_registry.ts');
5758

58-
if (!appPkg.visyn) {
59-
throw Error(`The package.json of ${appPkg.name} does not contain a 'visyn' entry.`);
59+
if (!appPkg[packageJsonKey]) {
60+
throw Error(`The package.json of ${appPkg.name} does not contain a '${packageJsonKey}' entry.`);
6061
}
6162

6263
/**
@@ -86,7 +87,7 @@ module.exports = (webpackEnv, argv) => {
8687
// ignore if file does not exist
8788
}
8889

89-
let { devServerProxy, entries, copyFiles, historyApiFallback } = appPkg.visyn;
90+
let { bundlesFolder = 'bundles', devServerProxy, entries, copyFiles, historyApiFallback } = appPkg[packageJsonKey];
9091

9192
if (isDevServerOnly) {
9293
// If we do yarn start dev_server_only=true, we only want to start the dev server and not build the app (i.e. for proxy support).
@@ -120,7 +121,7 @@ module.exports = (webpackEnv, argv) => {
120121
},
121122
devServer: isEnvDevelopment
122123
? {
123-
static: path.resolve(workspacePath, 'bundles'),
124+
static: path.resolve(workspacePath, bundlesFolder),
124125
compress: true,
125126
// Explicitly set hot to true and liveReload to false to ensure that hot is preferred over liveReload
126127
hot: true,
@@ -155,7 +156,7 @@ module.exports = (webpackEnv, argv) => {
155156
: undefined,
156157
output: {
157158
// The build folder.
158-
path: path.join(workspacePath, 'bundles'),
159+
path: path.join(workspacePath, bundlesFolder),
159160
// Add /* filename */ comments to generated require()s in the output.
160161
// TODO: rspack: pathinfo: isEnvDevelopment,
161162
// There will be one main bundle, and one file per asynchronous chunk.
@@ -414,12 +415,12 @@ module.exports = (webpackEnv, argv) => {
414415
patterns: [
415416
...(copyFiles?.map((file) => ({
416417
from: path.join(workspacePath, file),
417-
to: path.join(workspacePath, 'bundles', path.basename(file)),
418+
to: path.join(workspacePath, bundlesFolder, path.basename(file)),
418419
})) || []),
419420
...[
420421
fs.existsSync(workspaceMetaDataFile) && {
421422
from: workspaceMetaDataFile,
422-
to: path.join(workspacePath, 'bundles', 'phoveaMetaData.json'),
423+
to: path.join(workspacePath, bundlesFolder, 'phoveaMetaData.json'),
423424
// @ts-expect-error TODO: check why https://webpack.js.org/plugins/copy-webpack-plugin/#transform is not in the typing.
424425
transform: () => {
425426
function resolveScreenshot(appDirectory) {
@@ -450,7 +451,7 @@ module.exports = (webpackEnv, argv) => {
450451
// use package-lock json as buildInfo
451452
fs.existsSync(workspaceBuildInfoFile) && {
452453
from: workspaceBuildInfoFile,
453-
to: path.join(workspacePath, 'bundles', 'buildInfo.json'),
454+
to: path.join(workspacePath, bundlesFolder, 'buildInfo.json'),
454455
},
455456
].filter(Boolean),
456457
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visyn_scripts",
33
"description": "",
4-
"version": "15.1.4",
4+
"version": "15.1.5",
55
"author": {
66
"name": "datavisyn GmbH",
77
"email": "[email protected]",

0 commit comments

Comments
 (0)