0.0.11 • Published 23 days ago
@websolutespa/ws-vite v0.0.11
🔵 ws-vite
WsVite is an highly opinionated boilerplate built with Vite and used by Websolute web agency.
It offers a simple configuration step with vite.config.js
file.
WsDev is the official monorepo of the ws-vite and ws-cli plugin and boilerplate samples of Websolute web agency.
Using this repository
Install dependencies
npm i @websolutespa/ws-vite --save-dev
Create
vite.config.js
import wsVite from '@websolutespa/ws-vite';
import main from './src/theme/main.json';
import theme from './src/theme/theme.json';
export default wsVite({
paths: {
src: './src',
dist: './dist',
assets: './assets',
images: './assets/img',
icons: './assets/icons',
},
theme,
twig: {
globals: {
...main,
theme,
},
},
icons: true,
image: true,
html: {
prettify: true,
minify: true,
},
accessible: true,
server: {
host: 'localhost',
port: 8000,
},
});
However you can go deep in customization and offer your own vite.config.js
using the internal plugin framework:
vite.config.js
import {wsVitePlugin} from '@websolutespa/ws-vite';
import main from './src/theme/main.json';
import theme from './src/theme/theme.json';
export default {
// ... other config options
plugins: [
wsVitePlugin({
theme,
twig: {
globals: {
...main,
theme,
},
},
icons: true,
image: true,
html: {
prettify: true,
minify: true,
},
accessible: true,
})
],
};