2022-08-16 13:17:51 +00:00
# developtools_ace_ets2bundle
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Description
Provide declarative paradigm syntax compilation conversion, syntax verification, rich and friendly syntax error prompting capabilities.
2021-09-03 08:17:18 +00:00
2022-04-01 02:49:38 +00:00
#### Software Architecture
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
* compiler/src: source code
* test: unit test file
* .eslintrc: eslint configure
* babel.config.js: babel configure
* main.js: source code
* package.json: define what libraries will be installed into node_modules when you run `npm install`
* tsconfig.json: the compiler options required to compile the project
* webpack.config.js: webpack configuration information
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Prerequisites
2021-09-03 08:17:18 +00:00
```
> npm -v
6.14.8
> node -v
v12.18.3
```
2022-04-01 02:49:38 +00:00
Please install the **latest stable version** .
2021-09-03 08:17:18 +00:00
2022-04-01 02:49:38 +00:00
#### Installing
2021-09-03 08:17:18 +00:00
2022-04-01 02:49:38 +00:00
Enter the root directory of the compiler:
2021-09-03 08:17:18 +00:00
```
npm config set registry http://registry.npm.taobao.org
npm config set strict-ssl false
npm cache clean -f
npm install
```
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Quick Start
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
Enter the root directory of the compiler:
2021-09-03 08:17:18 +00:00
```
npm run build
npm run compile
```
2022-04-01 02:49:38 +00:00
The `sample` project will be compiled. The output is in the `sample/build` directory.
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Creating a Project
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
Enter the root directory of the compiler:
2021-09-03 08:17:18 +00:00
```
npm run create [projectName]
```
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
**Note**: If `projectName` is not specified, the `HelloAce` project will be compiled.
For example, use the following line to create a project named `foo` :
2021-09-03 08:17:18 +00:00
```
$ npm run create foo
```
2022-04-01 02:49:38 +00:00
The directory structure of project `foo` :
2021-09-03 08:17:18 +00:00
- foo
- pages
- index.ets
- app.ets
- manifest.json
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Creating a Page
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
For example, create a file `bar.ets` in the `pages` directory. And then add the following lines to `"pages"` field in `manifest.json` :
2021-09-03 08:17:18 +00:00
```
"pages": [
"pages/index",
"pages/bar"
]
```
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
#### Compiling a Project
2021-08-24 12:19:06 +00:00
2022-04-01 02:49:38 +00:00
Enter the root directory of the compiler:
2021-09-03 08:17:18 +00:00
```
$ npm run build
$ npm run compile [projectName]
```
2022-04-01 02:49:38 +00:00
**Note**: If `projectName` is not specified, the `sample` project will be compiled. In the project root directory, the compilation result is in the `build` directory.