Skip to content

Commit 923dd23

Browse files
authored
Merge pull request aws-amplify#4808 from nadetastic/js-getting-started
Update JS Getting Started steps to use `npm init` to create package.json
2 parents 96c43a9 + 62e3c5c commit 923dd23

File tree

1 file changed

+16
-25
lines changed
  • src/fragments/start/getting-started/vanillajs

1 file changed

+16
-25
lines changed

src/fragments/start/getting-started/vanillajs/setup.mdx

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,40 @@ Create a new ‘plain’ JavaScript <a href="https://babeljs.io/docs/en/learn/"
22

33
```bash
44
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
66
```
77

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+
817
The app directory structure should be:
918

1019
```console
1120
amplify-js-app
21+
├── node_modules/
22+
├── src/
23+
│   └── app.js
1224
├── index.html
25+
├── package-lock.json
1326
├── package.json
14-
├── src
15-
│   └── app.js
1627
└── webpack.config.js
1728
```
1829

19-
Add the following to the `package.json` file:
30+
Add the following scripts to the `package.json` file:
2031

2132
```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": {
3634
"start": "webpack && webpack-dev-server --mode development",
3735
"build": "webpack"
38-
}
3936
}
4037
```
4138

42-
### Install local development dependencies
43-
44-
```bash
45-
npm install
46-
```
47-
4839
Add the following to the `index.html` file:
4940

5041
```html

0 commit comments

Comments
 (0)