forked from rancher/kubewarden-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue.config.js
More file actions
24 lines (20 loc) · 871 Bytes
/
Copy pathvue.config.js
File metadata and controls
24 lines (20 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const path = require('path');
const config = require('@rancher/shell/vue.config');
module.exports = () => {
const vendorConfig = config(__dirname, { excludes: [] });
// Extend the chainWebpack hook to add our alias
if (typeof vendorConfig.chainWebpack === 'function') {
const originalChainWebpack = vendorConfig.chainWebpack;
vendorConfig.chainWebpack = (webpackConfig) => {
// Call the original chainWebpack configuration first
originalChainWebpack(webpackConfig);
// Add the @kubewarden alias pointing to the pkg/kubewarden folder
webpackConfig.resolve.alias.set('@kubewarden', path.resolve(__dirname, 'pkg/kubewarden'));
};
} else {
vendorConfig.chainWebpack = (webpackConfig) => {
webpackConfig.resolve.alias.set('@kubewarden', path.resolve(__dirname, 'pkg/kubewarden'));
};
}
return vendorConfig;
};