Skip to content

Commit f7d0118

Browse files
authored
feat: vulcan.config.js (#153)
2 parents fe24a19 + ee7b0c0 commit f7d0118

File tree

5 files changed

+341
-200
lines changed

5 files changed

+341
-200
lines changed

lib/build/bundlers/esbuild/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { NodeModulesPolyfillPlugin } from './plugins/node-polyfills/index.js';
1010
class Esbuild {
1111
constructor(builderConfig) {
1212
this.builderConfig = builderConfig;
13-
this.customConfig = builderConfig.custom;
13+
this.customConfigPreset = builderConfig.custom;
14+
this.customConfigLocal = builderConfig.localCustom;
1415
}
1516

1617
run = async () => {
@@ -20,14 +21,15 @@ class Esbuild {
2021
AZION_VERSION_ID: JSON.stringify(this.builderConfig.buildId),
2122
};
2223

23-
const hasCustomConfig = Object.keys(this.customConfig).length > 0;
24+
const hasCustomConfig = Object.keys(this.customConfigPreset).length > 0;
2425
if (hasCustomConfig) {
25-
config = merge(this.customConfig, config);
26+
config = merge(this.customConfigPreset, this.customConfigLocal, config);
2627
}
2728

2829
if (
2930
this.builderConfig.useNodePolyfills ||
30-
this.customConfig.useNodePolyfills
31+
this.customConfigPreset.useNodePolyfills ||
32+
this.customConfigLocal
3133
) {
3234
if (!config.plugins) config.plugins = [];
3335

lib/build/bundlers/webpack/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import AzionWebpackConfig from './webpack.config.js';
1010
class Webpack {
1111
constructor(builderConfig) {
1212
this.builderConfig = builderConfig;
13-
this.customConfig = builderConfig.custom;
13+
this.customConfigPreset = builderConfig.custom;
14+
this.customConfigLocal = builderConfig.localCustom;
1415
}
1516

1617
run = async () => {
@@ -25,9 +26,9 @@ class Webpack {
2526
...config.plugins,
2627
];
2728

28-
const hasCustomConfig = Object.keys(this.customConfig).length > 0;
29+
const hasCustomConfig = Object.keys(this.customConfigPreset).length > 0;
2930
if (hasCustomConfig) {
30-
config = merge(this.customConfig, config);
31+
config = merge(this.customConfigPreset, this.customConfigLocal, config);
3132
}
3233

3334
try {

0 commit comments

Comments
 (0)