UNPKG

3.21 kBMarkdownView Raw
1Composi
2=======
3
4Contents
5--------
6- [Installation](../README.md)
7- [JSX](./jsx.md)
8- [Hyperx](./hyperx.md)
9- [Hyperscript](./hyperscript.md)
10- [Functional Components](./functional-components.md)
11- [Mount, Render and Unmount](./render.md)
12- [Components](./components.md)
13- [State](./state.md)
14- [Lifecycle Methods](./lifecycle.md)
15- [Events](./events.md)
16- [Styles](./styles.md)
17- [Unmount](./unmount.md)
18- [State Management with DataStore](./data-store.md)
19- [Third Party Libraries](./third-party.md)
20- Deployment
21 - [CLI Deploy](#CLI-Deploy)
22 - [What Gets Deployed](#What-Gets-Deployed)
23 - [Changing Paths for Files](#Changing-Paths-for-Files)
24 - [Standalone](#Standalone)
25- [Differences with React](./composi-react.md)
26
27
28## Deployment
29
30After completing your project, you'll want to deploy it to where you will serve the site/app from. By default a Composi development project has a log of files and folder you don't need in deployment. The Composi command like can help you separate the final project from the development parts.
31
32## CLI Deploy
33
34The Composi CLI can separate out the parts you need for deployment from the parts you need for development. There a just a few steps to follow. Open the terminal. There are two flags for deployment:
35
361. `-d`: tells Composi to deploy. Should be followed by a space and the path to the project you want to deploy.
372. `-p`: the path to deploy your project at. Should be followed by space and then the path. If no `-p` is provided, it will deploy to the same location as the value of `-d`, along side the project being deployed.
38
39When Composi deploys you project, it uses the same name you gave but appends '-production' to the folder name. Internally all names will stay the same.
40
41```bash
42composi -d /Users/wobba/Desktop/test -p ~/dev
43```
44
45With the above command, you will find the deployed project at:
46
47```bash
48composi -d C:\Users\wobba\Desktop\test -p ~\dev
49```
50
51This would be deployed project at:
52
53```bash
54C:\Users\wobba\dev\test-production
55```
56>
57## What Gets Deployed
58
59When you deploy a project, Composi exports certain files and folders. They are all at the root leve of the project:
60
61```bash
62|--css
63|--icons
64|--images
65|--js
66|--index.html
67```
68
69The default Composi project build does not contain a folder for icons and images. However, if you want to use icons and images with your project, you can create these folders at the root of your project. Then during deployment Composi will include them. Everything in the above folders will be transfered to the deployment destination.
70
71## Changing Paths for Files
72
73Depending on how you intended to serve your project, you may need to change where CSS, icons, images and JavaScript reside. If this is so, be sure to adjust the paths to CSS and JavaScript in the `index.html` file, as well as any paths that for images in your `styles.css` file.
74
75## Standalone
76
77When you create the deployment version of your project, you get a standalone version. You could doubleclick the <code>index.html</code> to open it in your browser. Or you could open the terminal, <code>cd</code> to the deployed project and run an node server, such as [http-server](https://www.npmjs.com/package/http-server), in the project to launch it.
\No newline at end of file