Skip to content

Commit

Permalink
updates getPublicViteConfig function
Browse files Browse the repository at this point in the history
  • Loading branch information
ValJed committed Nov 5, 2024
1 parent 2b47132 commit d6a7ffe
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions lib/internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,27 +866,25 @@ module.exports = (self) => {
*/
async getPublicViteConfig(baseConfig) {
const vite = await import('vite');
// The base public config
const config = await vitePublicConfig({
input: self.getBuildInputs('public')
});

const mergeConfigs = vite.defineConfig(async (configEnv) => {
// The base public config
const publicConfig = await vitePublicConfig({
input: self.getBuildInputs('public')
});

// The postcss config
const postcssConfig = await vitePostcssConfig(
configEnv,
self.apos.asset.options,
self.apos.util
);
const postcssConfig = await vitePostcssConfig({
assetOptions: self.apos.asset.options,
util: self.apos.util,
isPublic: true
});

const config = {
...publicConfig,
...postcssConfig
};

const mergeConfigs = vite.defineConfig(async (configEnv) => {
// Module configurations
let merged = vite.mergeConfig(baseConfig, config);
let merged = vite.mergeConfig(baseConfig, publicConfig);
for (const { extensions, name } of self.getBuildEntrypointsFor('public')) {
if (!extensions) {
continue;
Expand Down

0 comments on commit d6a7ffe

Please sign in to comment.