UNPKG

3.05 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 and Render](./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- [Third Party Libraries](./third-party.md)
19- Deployment
20- [Differences with React](./composi-react.md)
21
22Deployment
23----------
24
25After 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.
26
27CLI Deploy
28----------
29
30The 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:
31
321. `-d`: tells Composi to deploy. Should be followed by a space and the path to the project you want to deploy.
332. `-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.
34
35When 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.
36
37```bash
38composi -d /Users/wobba/Desktop/test -p ~/dev
39```
40
41With the above command, you will find the deployed project at:
42
43```bash
44composi -d C:\Users\wobba\Desktop\test -p ~\dev
45```
46
47This would be deployed project at:
48
49```bash
50C:\Users\wobba\dev\test-production
51```
52
53What Gets Deployed
54------------------
55
56When you deploy a project, Composi exports certain files and folders. They are all at the root leve of the project:
57
58```bash
59|--css
60|--icons
61|--images
62|--js
63|--index.html
64```
65
66The 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.
67
68Changing Paths for Files
69------------------------
70
71Depending 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.
72
73Standalone
74----------
75
76When 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