UNPKG

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