simple-web-cli
Version:
â¡ A simple compiler to automate the development in HTML, CSS, SCSS, JavaScript, TypeScript and PHP languages, focused on Shared Hosts and using SFTP or FTP to deploy files processed automatically to final server.
113 lines (101 loc) ⢠2.66 kB
JavaScript
// @ts-check
import { defineConfig } from 'simple-web-cli';
export default defineConfig({
workspaces: {
src: 'src',
dist: 'dist',
},
start: {
compile: {
js: {
babel: true,
uglify: true,
},
scss: true,
css: {
autoprefixer: true,
uglifycss: true,
},
html: {
minify: true,
htmlImportLikeSass: true,
exclude: {
htmlImport: [],
},
},
htaccess: {
minify: true,
},
php: {
minify: true,
},
exclude: ['.min.css', '.min.js'],
},
},
build: {
level: 9,
output: 'release',
},
options: {
initialCommit: true,
},
/* --------------------------------------------- */
/* ---- A D V A N C E D O P T I O N S ---- */
/* --------------------------------------------- */
// ð®ð»ââïž Don't process neither copy source file to dist path
blacklist: ['.coffee', '.jsx', '.less', '.pug', '.tsx', '.git/', 'node_modules'],
/**
* ð You can only use one protocol: `SFTP` or `FTP`
* âïž Becareful: set access FTP data in an external .env or add the â.swrc.jsâ to .gitignore
*/
// sftp: {
// start: {
// root: '',
// host: '',
// username: '',
// password: '',
// },
// },
/** or */
// ftp: {
// start: {
// root: '',
// host: '',
// user: '',
// pass: '',
// secure: true,
// },
// },
plugins: {
// â¹ïž You can create an easy to read code and on compiling, replace the specified strings
stringReplace: {
strings: {
// âïž Always starts and ends the key string with: *
'*your-code-string*': {
start: 'my-start-output',
build: 'my-build-output',
},
},
// â¹ïž If you want more specific extensions, you can add them here
languages: {
html: true,
php: true,
phtml: true,
scss: true,
css: true,
htaccess: true,
js: true,
sql: false,
others: false,
},
},
// ð You can create a mirror project folder and add static resource files to replace temporary development files by this on compiling
resourceReplace: {
src: '.resources',
replace: {
start: false,
build: true,
},
},
},
});