This is a PERSONAL project made to create the Web component and the folder structure that I normally use.
src
|__cmponents
|__webComponentUno
| |--webComponentUno.js
| |--webComponentUno.css
|__webComponentDos
| |--webComponentDos.js
| |--webComponentDos.css
|--component.js
I Try to make this Project with as few dependencies as possible.
ESM: The brilliantly simple, babel-less, bundle-less ECMAScript module loader.
COMANDER.JS: The complete solution for node.js command-line interfaces.
$ npm install -g jsvanillawebcomponentcli
Be sure to include in your Html5 a meta tag that links to the components.js module
Ej:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
*** Your html code Here ***
<script type="module" src="./src/components/components.js"></script>
</body>
</html>
now run it in your console
$ webc component componentName
or
$ webc c componentName
Make sure your component name is written in CamellCase format
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.