autofront 1.5.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/index.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,6 +38,13 @@ The main supported packages/languages/libraries are:
|
|
|
38
38
|
require('autofront');
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
Optionally, to work with [HTML5 mode](https://docs.angularjs.org/api/ng/provider/$locationProvider#html5Mode), invoke `html5Mode` to prefix path of assets.
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
var autofront = require('autofront');
|
|
45
|
+
autofront.html5Mode();
|
|
46
|
+
```
|
|
47
|
+
|
|
41
48
|
### Folder structure
|
|
42
49
|
|
|
43
50
|
Here is the essential basic organization you must to put in your project:
|
package/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
this.html5Mode = html5Mode;
|
|
2
|
+
|
|
1
3
|
const gulp = require('gulp'),
|
|
2
4
|
args = require('get-gulp-args')(),
|
|
3
5
|
mergeStream = require('merge-stream'),
|
|
@@ -12,9 +14,9 @@ var domain = undefined;
|
|
|
12
14
|
|
|
13
15
|
const allFiles = getFiles(),
|
|
14
16
|
indexHtmlFile = 'index.html',
|
|
15
|
-
stylesFolder = 'styles/',
|
|
16
17
|
cssFilename = 'index',
|
|
17
|
-
cssFullFilename = cssFilename+'.css'
|
|
18
|
+
cssFullFilename = cssFilename+'.css';
|
|
19
|
+
var stylesFolder = 'styles/',
|
|
18
20
|
jsTemplatesFile = 'scripts/templates.js';
|
|
19
21
|
|
|
20
22
|
const paths = {
|
|
@@ -118,6 +120,12 @@ gulp.task('serve:dist', ['build'], () => browserSyncInit(paths.dist));
|
|
|
118
120
|
|
|
119
121
|
gulp.task('default', ['serve']);
|
|
120
122
|
|
|
123
|
+
function html5Mode() {
|
|
124
|
+
const pathPrefix = '/';
|
|
125
|
+
stylesFolder = pathPrefix + stylesFolder;
|
|
126
|
+
jsTemplatesFile = pathPrefix + jsTemplatesFile;
|
|
127
|
+
}
|
|
128
|
+
|
|
121
129
|
function getFiles(ext) {
|
|
122
130
|
ext = ext || '*';
|
|
123
131
|
const isArray = typeof ext != 'string';
|