You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,14 @@ This path is relative to the folder you are located in. It is recommended that t
73
73
74
74
If the `launch` argument is not provided, the [default launch screen](https://github.com/scriptex/create-pwa/blob/master/launch.png) is used.
75
75
76
+
3.`output`: Specifies a relative path to the output directory.
77
+
78
+
This path is relative to the folder you are located in.
79
+
80
+
**The `output` argument is not required.**
81
+
82
+
If the `output` argument is not provided, the default value for it is empty string (the root of your project or the location of your `package.json` file).
83
+
76
84
## Usage
77
85
78
86
If you want to use if from the command line, you should first install Create PWA globally:
@@ -122,15 +130,15 @@ When the files(`manifest.json` and `service-worker.js`) are ready for production
122
130
123
131
Feel adviced to edit the content of the `<TileColor>` tag in the `config.xml` file as it matches the color of your application's status bar on Chrome (found in the `<meta name="color" />` tag);
124
132
125
-
1.Add the following to the `head` of your HTML file(s):
133
+
1. Add the following to the `head` of your HTML file(s):
126
134
127
135
```html
128
136
<linkrel="manifest"href="manifest.json" />
129
137
```
130
138
131
139
You can read more about the Web App Manifest [here](https://developers.google.com/web/fundamentals/web-app-manifest/).
132
140
133
-
2.Add the following snippet to your application's JavaScript bundle or place it in a `script` tag just before the closing `</body>` tag in your HTML file(s):
141
+
2. Add the following snippet to your application's JavaScript bundle or place it in a `script` tag just before the closing `</body>` tag in your HTML file(s):
134
142
135
143
```javascript
136
144
if ('serviceWorker'innavigator) {
@@ -477,8 +485,9 @@ You can generate each of the components above separately using the Create PWA AP
477
485
```javascript
478
486
const { setAppCache } =require('create-pwa');
479
487
constappName='Your application name';
488
+
constdistFolder='dist';
480
489
481
-
setAppCache(appName);
490
+
setAppCache(appName, distFolder);
482
491
```
483
492
484
493
**The generated `appcache` file contains references to the application icons and application launch screens. You must have these already generated otherwise you must edit your `appcache` file and remove them.**
**The generated `manifest.json` file contains references to the application icons. You must have these already generated otherwise you must edit your `manifest.json` file and remove them.**
**The generated `service-worker.js` file contains references to the application icons and application launch screens. You must have these already generated otherwise you must edit your `service-worker.js` file and remove them.**
0 commit comments