Skip to content

Move to vite#270

Merged
ai merged 10 commits intopostcss:mainfrom
sult4novars:move-to-vite
Feb 10, 2022
Merged

Move to vite#270
ai merged 10 commits intopostcss:mainfrom
sult4novars:move-to-vite

Conversation

@sult4novars
Copy link
Copy Markdown
Contributor

Hi! I try to resolve this issue.

@sult4novars sult4novars mentioned this pull request Feb 9, 2022
@TheSeally
Copy link
Copy Markdown

@sult4novars, we already have plugin for pug tranforming. I've made similar fixes, you can see settings there https://github.com/logux/logux.io/blob/main/vite.config.js

@sult4novars
Copy link
Copy Markdown
Contributor Author

@TheSeally hi! cool! I haven't known about this plugin. I will look through it and try to use it in my solution. thx)

Comment thread package.json
Comment thread package.json Outdated
Comment thread vite.config.js Outdated
Comment thread src/index.html Outdated
@@ -0,0 +1 @@
<pug src="./index.pug" /> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As for me it is better to move some parts from index.pug to index.html (like head, body, and other important parts of HTML). I think this will improve readability

Like here

Comment thread scripts/build-home.js Outdated
Comment thread design/pnpm-lock.yaml Outdated
Comment thread scripts/build-api.js Outdated
Comment thread src/api.html Outdated
Comment thread vite.config.js
Comment thread vite.config.js Outdated
Comment thread package.json
Comment thread scripts/build-api.js
sourceMaps: false,
mode: 'production'
let data = await vite.build({
plugins: [vitePugPlugin()],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We can try to use conditional vite.config. We can pass argument to build commands (or use env variable) to specify what type of build starts and change settings like outDir in vite.config. This will remove duplication and leave the configuration in one place

@ai what do you think?

@ai ai merged commit 73ae9d0 into postcss:main Feb 10, 2022
@sult4novars sult4novars deleted the move-to-vite branch February 11, 2022 14:25
@sult4novars
Copy link
Copy Markdown
Contributor Author

@ai @TheSeally thanks for review))

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.

3 participants