Skip to content

(feat): add vite config#45

Merged
YvetteNikolov merged 26 commits into
mainfrom
feat/add-vite-config
Aug 18, 2025
Merged

(feat): add vite config#45
YvetteNikolov merged 26 commits into
mainfrom
feat/add-vite-config

Conversation

@YvetteNikolov
Copy link
Copy Markdown
Contributor

@YvetteNikolov YvetteNikolov commented Jul 30, 2025

@yardinternet/vite-config toegevoegd en Vite integratie toegevoegd aan de toolkit.

Je hebt nu twee modussen (watch of build) en twee scripts die Vite aftrappen:

Deze scripts wil ik vrijdag tijdens de kennisdeling toelichten.

Verder:

  • Centrale logger toegevoegd: oude error-utilities vervangen door een nieuwe logger voor uniformiteit
  • Documentatie geupdatet

Er staat nog een PR open bij de repo van EvoMark voor het builden van de blocks. Deze moet gemerged worden, en anders moeten we de repo forken:

Ik heb uiteindelijk de repo geforked.


```json
{
"scripts": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idealiter zal het nog mooier zijn als deze scripts ook weer in de toolkit worden gedefined

Comment thread packages/toolkit/src/actions/lint.js Outdated
error(
`Filetype '${ formatFiletype.name }' not possible with lint action.`
);
let command = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mooi gedaan

msg = 'An error occurred',
die = true,
exitCode = 1
export const runCommand = async (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netjes!


try {
const { stdout } = await execWithEnv(
`vite build --emptyOutDir --config vite-blocks.config.js`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moet vite-blocks.config.js niet vervangen worden voor ${configFile}?

themes.map( async ( theme ) => {
log.info( `Building theme: ${ theme }` );
try {
const { stdout } = await execWithEnv( `vite build`, {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is het niet handig om met een param configFile mee te geven (nu pakt hij denk ik by default vite.config.js.
Dan kan je ook een andere file gebruiken (ik gok dat dat ook de bedoeling was)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Het zelfde gaat op voor watchBlocks

*/
import log from '../utils/logger.js';

export const watchThemes = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is het niet mooi als je hier net als bij build themes en blocks ook een config naam kan mee geven?

Comment thread packages/vite-config/package.json Outdated
"vite": "^6.3.5"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.46.1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suf dat dit nodig is

* Generates the aliases for each theme to use like `@theme-name`.
* Example: `background-image: url('@sage/images/logo.svg')`; or `import '@sage-child/scripts/frontend/frontend.js';`
*/
const generateAliases = ( themeNames ) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handig dit

@YvetteNikolov YvetteNikolov merged commit e214ba5 into main Aug 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants