File tree Expand file tree Collapse file tree 1 file changed +16
-25
lines changed
src/fragments/start/getting-started/vanillajs Expand file tree Collapse file tree 1 file changed +16
-25
lines changed Original file line number Diff line number Diff line change @@ -2,49 +2,40 @@ Create a new ‘plain’ JavaScript <a href="https://babeljs.io/docs/en/learn/"
2
2
3
3
``` bash
4
4
mkdir -p amplify-js-app/src && cd amplify-js-app
5
- touch package.json index.html webpack.config.js src/app.js
5
+ touch index.html src/app.js webpack.config .js
6
6
```
7
7
8
+ Initialize npm and install dependencies and dev dependencies.
9
+
10
+ ``` bash
11
+ npm init
12
+ npm install aws-amplify
13
+ npm install webpack webpack-cli webpack-dev-server copy-webpack-plugin --save-dev
14
+ ```
15
+
16
+
8
17
The app directory structure should be:
9
18
10
19
``` console
11
20
amplify-js-app
21
+ ├── node_modules/
22
+ ├── src/
23
+ │ └── app.js
12
24
├── index.html
25
+ ├── package-lock.json
13
26
├── package.json
14
- ├── src
15
- │ └── app.js
16
27
└── webpack.config.js
17
28
```
18
29
19
- Add the following to the ` package.json ` file:
30
+ Add the following scripts to the ` package.json ` file:
20
31
21
32
``` json
22
- {
23
- "name" : " amplify-js-app" ,
24
- "version" : " 1.0.0" ,
25
- "description" : " Amplify JavaScript Example" ,
26
- "dependencies" : {
27
- "aws-amplify" : " latest"
28
- },
29
- "devDependencies" : {
30
- "copy-webpack-plugin" : " ^6.1.0" ,
31
- "webpack" : " ^4.46.0" ,
32
- "webpack-cli" : " ^4.9.1" ,
33
- "webpack-dev-server" : " ^4.4.0"
34
- },
35
- "scripts" : {
33
+ "scripts" : {
36
34
"start" : " webpack && webpack-dev-server --mode development" ,
37
35
"build" : " webpack"
38
- }
39
36
}
40
37
```
41
38
42
- ### Install local development dependencies
43
-
44
- ``` bash
45
- npm install
46
- ```
47
-
48
39
Add the following to the ` index.html ` file:
49
40
50
41
``` html
You can’t perform that action at this time.
0 commit comments