@videinfra/static-website-builder 2.0.4 → 2.0.5

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.
Files changed (122) hide show
  1. package/.prettierrc +11 -11
  2. package/CHANGELOG.md +222 -214
  3. package/README.md +102 -102
  4. package/bin/builder.js +40 -40
  5. package/eslint.config.js +39 -39
  6. package/gulpfile.js +63 -63
  7. package/init/default/config/config.js +44 -44
  8. package/init/default/src/html/data/global.js +9 -9
  9. package/init/default/src/javascripts/_entries.js +14 -14
  10. package/init/index.js +63 -63
  11. package/init/test/.env +6 -6
  12. package/init/test/.env.local +3 -3
  13. package/init/test/config/config.js +71 -71
  14. package/init/test/src/html/404.twig +12 -12
  15. package/init/test/src/html/data/global.js +10 -10
  16. package/init/test/src/html/env.twig +21 -21
  17. package/init/test/src/html/layouts/base.twig +1 -1
  18. package/init/test/src/html/other.twig +9 -9
  19. package/init/test/src/html/preposition.twig +4 -4
  20. package/init/test/src/javascripts/_entries-alt.js +10 -10
  21. package/init/test/src/javascripts/_entries.js +19 -19
  22. package/init/test/src/javascripts/common.js +13 -13
  23. package/init/test/src/javascripts/main.js +8 -8
  24. package/init/test/src/javascripts/something.ts +9 -9
  25. package/init/test/src/stylesheets/autoprefixer-test.scss +3 -3
  26. package/init/test/src/stylesheets/env-test.scss +28 -28
  27. package/init/test/src/stylesheets/ignore-test.scss +4 -4
  28. package/init/test/src/stylesheets/nested-calc-test.scss +3 -3
  29. package/init/test/src/stylesheets/sub-folder/import-test.scss +2 -2
  30. package/lib/camelize-file-name.js +21 -21
  31. package/lib/generate-gulp-tasks.js +85 -85
  32. package/lib/get-config.js +203 -203
  33. package/lib/get-file-names.js +23 -23
  34. package/lib/get-path.js +102 -102
  35. package/lib/globs-helper.js +243 -243
  36. package/lib/gulp/dynamic-task.js +8 -8
  37. package/lib/gulp/resolve-dynamic-task.js +11 -11
  38. package/lib/gulp/task-before-dest.js +8 -8
  39. package/lib/gulp/task-end.js +10 -10
  40. package/lib/gulp/task-start.js +12 -12
  41. package/lib/gulp/task-watch.js +66 -66
  42. package/lib/init/copy-folder.js +50 -50
  43. package/lib/init/folder-exists.js +10 -10
  44. package/lib/init/get-folder-list.js +16 -16
  45. package/lib/init/merge-package.js +17 -17
  46. package/lib/init/read-package.js +17 -17
  47. package/lib/log-error.js +15 -15
  48. package/lib/merge.js +27 -27
  49. package/lib/run-preprocess.js +32 -32
  50. package/lib/task-order.js +19 -19
  51. package/package.json +68 -68
  52. package/plugins/example/preprocess-config.js +17 -17
  53. package/plugins/example/task.js +55 -55
  54. package/plugins/example.js +38 -38
  55. package/plugins/sass-engine/preprocess-config.js +59 -59
  56. package/plugins/sass.js +41 -41
  57. package/plugins/twig/lodash-filters/filters.js +91 -91
  58. package/plugins/twig/lodash-filters.js +14 -14
  59. package/plugins/twig/symfony-filters/filters.js +102 -102
  60. package/plugins/twig/symfony-filters/preposition_nbsp.js +77 -77
  61. package/plugins/twig/symfony-filters.js +14 -14
  62. package/plugins/twig/symfony-functions/functions.js +31 -31
  63. package/plugins/twig/symfony-functions.js +14 -14
  64. package/plugins/twig-engine/preprocess-config.js +53 -53
  65. package/plugins/twig.js +74 -74
  66. package/tasks/browser-sync/config.js +39 -39
  67. package/tasks/browser-sync/preprocess-config.js +32 -32
  68. package/tasks/browser-sync/task.js +9 -9
  69. package/tasks/clean/config.js +20 -20
  70. package/tasks/clean/preprocess-config.js +19 -19
  71. package/tasks/clean/task.js +7 -7
  72. package/tasks/data/config.js +34 -34
  73. package/tasks/data/data-loader-js.js +14 -14
  74. package/tasks/data/data-loader-json.js +5 -5
  75. package/tasks/data/get-data.js +135 -96
  76. package/tasks/env/config.js +26 -26
  77. package/tasks/env/get-env.js +113 -113
  78. package/tasks/fonts/config.js +24 -24
  79. package/tasks/fonts/task.js +47 -47
  80. package/tasks/global/config.js +7 -7
  81. package/tasks/html/config.js +42 -42
  82. package/tasks/html/task.js +91 -91
  83. package/tasks/icons/config.js +47 -47
  84. package/tasks/icons/preprocess-config.js +60 -60
  85. package/tasks/icons/task.js +56 -56
  86. package/tasks/images/config.js +27 -27
  87. package/tasks/images/task.js +46 -46
  88. package/tasks/javascripts/config.js +69 -69
  89. package/tasks/javascripts/preprocess-config.js +109 -109
  90. package/tasks/javascripts/task.js +86 -86
  91. package/tasks/sitemap/config.js +48 -48
  92. package/tasks/sitemap/preprocess-config.js +18 -18
  93. package/tasks/sitemap/task.js +69 -69
  94. package/tasks/sizereport/config.js +23 -23
  95. package/tasks/sizereport/task.js +16 -16
  96. package/tasks/static/config.js +27 -27
  97. package/tasks/static/task.js +46 -46
  98. package/tasks/stylesheets/config.js +85 -85
  99. package/tasks/stylesheets/preprocess-config.js +41 -41
  100. package/tasks/stylesheets/task.js +73 -73
  101. package/tests/build/build.test.js +159 -153
  102. package/tests/camelize-file-name.test.js +11 -11
  103. package/tests/generate-gulp-tasks.test.js +78 -78
  104. package/tests/glob-helper.test.js +99 -99
  105. package/tests/merge.test.js +10 -10
  106. package/tests/preposition_nbsp.test.js +50 -50
  107. package/tests/run-preprocess.test.js +90 -90
  108. package/tests/sass-stringify.test.js +24 -24
  109. package/tests/sitemap.test.js +12 -12
  110. package/vendor/gulp-rolldown/index.js +151 -151
  111. package/vendor/gulp-rolldown/plugin-raw.js +17 -17
  112. package/vendor/gulp-rolldown/plugin-virtual-entry.js +30 -30
  113. package/vendor/gulp-sass/CHANGELOG.md +168 -168
  114. package/vendor/gulp-sass/LICENSE +20 -20
  115. package/vendor/gulp-sass/README.md +187 -187
  116. package/vendor/gulp-sass/index.js +208 -208
  117. package/vendor/gulp-sass/package.json +61 -61
  118. package/vendor/gulp-sass/sass-stringify.js +32 -32
  119. package/vendor/gulp-twig/LICENSE +20 -20
  120. package/vendor/gulp-twig/README.md +167 -167
  121. package/vendor/gulp-twig/index.js +138 -138
  122. package/vendor/gulp-twig/package.json +44 -44
package/.prettierrc CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "trailingComma": "all",
3
- "useTabs": false,
4
- "tabWidth": 4,
5
- "semi": true,
6
- "singleQuote": true,
7
- "printWidth": 280,
8
- "bracketSpacing": true,
9
- "bracketSameLine": false,
10
- "arrowParens": "always"
11
- }
1
+ {
2
+ "trailingComma": "all",
3
+ "useTabs": false,
4
+ "tabWidth": 4,
5
+ "semi": true,
6
+ "singleQuote": true,
7
+ "printWidth": 280,
8
+ "bracketSpacing": true,
9
+ "bracketSameLine": false,
10
+ "arrowParens": "always"
11
+ }
package/CHANGELOG.md CHANGED
@@ -1,214 +1,222 @@
1
- # Change Log
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/).
6
-
7
- ## [2.0.3] - 2026-02-03
8
- ### Added
9
- - Allow writing ASSETS_VERSION to .env file
10
-
11
- ## [2.0.0] - 2026-01-27
12
- ### Added
13
- - Replaced webpack with rolldown
14
-
15
- ## [1.17.1] - 2026-01-23
16
- ### Added
17
- - Sitemap generation in watch mode too
18
-
19
- ## [1.17.0] - 2026-01-15
20
- ### Added
21
- - Added sitemap task
22
-
23
- ## [1.16.3] - 2025-10-29
24
- ### Updated
25
- - Added `embed` to TWIG dependency tracking
26
-
27
- ## [1.16.2] - 2025-10-29
28
- ### Updated
29
- - Changed `sass` to sync for better performance
30
-
31
- ## [1.16.0] - 2025-10-22
32
- ### Updated
33
- - Removed `node-sass` and use `sass` module
34
-
35
- ## [1.15.11] - 2025-10-08
36
- - Updated "preposition_nbsp" TWIG filter
37
-
38
- ## [1.15.10] - 2025-09-26
39
- - Updated "preposition_nbsp" TWIG filter
40
-
41
- ## [1.15.9] - 2025-09-10
42
- - Added dashes to the "preposition_nbsp" TWIG filter
43
-
44
- ## [1.15.7] - 2025-07-31
45
- ### Added
46
- - Optional chaining to the JS
47
-
48
- ## [1.15.5] - 2025-05-16
49
- ### Added
50
- - "preposition_nbsp" TWIG filter
51
-
52
- ## [1.15.0] - 2025-01-20
53
- ### Added
54
- - Env file support
55
-
56
- ## [1.14.0] - 2025-01-16
57
- ### Added
58
- - Fail build process when TWIG task fails
59
-
60
- ## [1.13.4] - 2024-10-08
61
- ### Fixed
62
- - Fail gulp process when htmlmin task fails
63
-
64
- ## [1.13.1] - 2024-09-19
65
- ### Added
66
- - Fail whole gulp process when one of the tasks fail
67
-
68
- ## [1.13.0] - 2024-08-23
69
- ### Added
70
- - Added 'outpuSubFolder' property to entries configuration
71
-
72
- ## [1.12.1] - 2024-08-19
73
- ### Added
74
- - Version string to the dynamically loaded JS files
75
-
76
- ## [1.12.0] - 2024-02-25
77
- ### Added
78
- - Support for multiple entry lists which each has its own "shared" chunk file
79
-
80
- ## [1.11.1] - 2024-02-24
81
- ### Fixed
82
- - Fixed dependencies
83
-
84
- ## [1.11.0] - 2024-02-24
85
- ### Updated
86
- - Added dynamic entries, webpack will rebuild when entries change
87
-
88
- ## [1.10.1] - 2024-02-13
89
- ### Fixed
90
- - TWIG config
91
-
92
- ## [1.10.0] - 2024-02-13
93
- ### Updated
94
- - Changed TWIG to use async mode by default, added option
95
- - Enabled TWIG cache for improved production builds
96
-
97
- ## [1.9.1] - 2023-11-01
98
- ### Fixed
99
- - Fixed public path for dynamic imports
100
-
101
- ## [1.9.0] - 2023-08-16
102
- ### Updated
103
- - Downgraded nano-memoize version
104
-
105
- ## [1.8.0] - 2023-08-10
106
- ### Updated
107
- - Dependencies
108
- ### Removed
109
- - postcss-ignore-plugin
110
- ### Added
111
- - CSS tests
112
-
113
- ## [1.7.0] - 2023-05-25
114
- ### Updated
115
- - Depedencies
116
- - Added autoprefixer test
117
-
118
- ## [1.6.4] - 2023-03-29
119
- ### Updated
120
- - Added stylesheet source path to the default include paths
121
-
122
- ## [1.6.3] - 2022-10-25
123
- ### Fixed
124
- - Error fix for OSX when changing any HTML file
125
-
126
- ## [1.6.1] - 2022-10-21
127
- ### Fixed
128
- - `false` task config being overwritten by empty array resulting in task being performed
129
-
130
- ## [1.6.0] - 2022-06-20
131
- ### Updated
132
- - gulp-sass to use latest node-sass version
133
- ### Added
134
- - `stylesheets.legacy` configuration option to turn off `node-sass` and use `sass`
135
-
136
- ## [1.5.2] - 2022-06-17
137
- ### Updated
138
- - In build mode prevent data from being read more than once
139
-
140
- ## [1.5.1] - 2022-04-14
141
- ### Fixed
142
- - Dependency update
143
-
144
- ## [1.5.0] - 2022-04-13
145
- ### Fixed
146
- - Read files in `data` folder recursively
147
-
148
- ## [1.4.3] - 2022-03-08
149
- ### Fixed
150
- - Fixed negative glob paths not working
151
-
152
- ## [1.4.2] - 2021-08-27
153
- ### Fixed
154
- - Fixed postcss-ignore-plugin only removing and adding content in unrelated files
155
-
156
- ## [1.4.1] - 2021-05-20
157
- ### Fixed
158
- - Enabled postcss-ignore-plugin only when cssnano is used
159
-
160
- ## [1.4.0] - 2021-05-20
161
- ### Added
162
- - Added postcss-ignore-plugin
163
-
164
- ## [1.3.2] - 2021-04-07
165
- ### Added
166
- - Added gulp-dependents plugin to the .scss files for faster builds
167
-
168
- ## [1.3.1] - 2021-02-22
169
- ### Fixed
170
- - data JS files not being usable with "require"
171
-
172
- ## [1.3.0] - 2021-01-27
173
- ### Changed
174
- - Replaced gulp.watch with latest chokidar which is more reliable
175
-
176
- ## [1.2.8] - 2020-11-12
177
- ### Changed
178
- - Updated dependencies
179
-
180
- ## [1.2.7] - 2020-11-03
181
- ### Added
182
- - Command `--tasks` to list available tasks
183
-
184
- ## [1.2.6] - 2020-10-28
185
- ### Removed
186
- - gulp-util dependency
187
-
188
- ## [1.2.5] - 2020-09-24
189
- ### Fixed
190
- - cssnano configuration
191
- - disabled `calc()` minification which minifies them incorrectly
192
-
193
- ## [1.2.4] - 2020-09-16
194
- ### Added
195
- - 'ignore' to data task configuration
196
-
197
- ## [1.2.3] - 2020-09-07
198
- ### Fixed
199
- - fixed gulp not working if there is an error when starting watch command
200
-
201
- ## [1.2.2] - 2020-08-18
202
- ### Fixed
203
- - fixed production mode detection being triggered in development mode
204
-
205
- ## [1.2.1] - 2020-07-13
206
- ### Added
207
- - gulp-util to the dependencies
208
-
209
-
210
- ## [1.2.0] - 2020-07-13
211
- ### Removes
212
- - .browserlistrc which was overriding per-project browser list
213
- ### Changed
214
- - Any task with `-build` in the name will now trigger `production` mode
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [2.0.5] - 2026-02-12
8
+ ### Added
9
+ - Expose `currentPagePath` to Twig templates
10
+
11
+ ## [2.0.4] - 2026-02-11
12
+ ### Fixed
13
+ - Path error on windows
14
+
15
+ ## [2.0.3] - 2026-02-03
16
+ ### Added
17
+ - Allow writing ASSETS_VERSION to .env file
18
+
19
+ ## [2.0.0] - 2026-01-27
20
+ ### Added
21
+ - Replaced webpack with rolldown
22
+
23
+ ## [1.17.1] - 2026-01-23
24
+ ### Added
25
+ - Sitemap generation in watch mode too
26
+
27
+ ## [1.17.0] - 2026-01-15
28
+ ### Added
29
+ - Added sitemap task
30
+
31
+ ## [1.16.3] - 2025-10-29
32
+ ### Updated
33
+ - Added `embed` to TWIG dependency tracking
34
+
35
+ ## [1.16.2] - 2025-10-29
36
+ ### Updated
37
+ - Changed `sass` to sync for better performance
38
+
39
+ ## [1.16.0] - 2025-10-22
40
+ ### Updated
41
+ - Removed `node-sass` and use `sass` module
42
+
43
+ ## [1.15.11] - 2025-10-08
44
+ - Updated "preposition_nbsp" TWIG filter
45
+
46
+ ## [1.15.10] - 2025-09-26
47
+ - Updated "preposition_nbsp" TWIG filter
48
+
49
+ ## [1.15.9] - 2025-09-10
50
+ - Added dashes to the "preposition_nbsp" TWIG filter
51
+
52
+ ## [1.15.7] - 2025-07-31
53
+ ### Added
54
+ - Optional chaining to the JS
55
+
56
+ ## [1.15.5] - 2025-05-16
57
+ ### Added
58
+ - "preposition_nbsp" TWIG filter
59
+
60
+ ## [1.15.0] - 2025-01-20
61
+ ### Added
62
+ - Env file support
63
+
64
+ ## [1.14.0] - 2025-01-16
65
+ ### Added
66
+ - Fail build process when TWIG task fails
67
+
68
+ ## [1.13.4] - 2024-10-08
69
+ ### Fixed
70
+ - Fail gulp process when htmlmin task fails
71
+
72
+ ## [1.13.1] - 2024-09-19
73
+ ### Added
74
+ - Fail whole gulp process when one of the tasks fail
75
+
76
+ ## [1.13.0] - 2024-08-23
77
+ ### Added
78
+ - Added 'outpuSubFolder' property to entries configuration
79
+
80
+ ## [1.12.1] - 2024-08-19
81
+ ### Added
82
+ - Version string to the dynamically loaded JS files
83
+
84
+ ## [1.12.0] - 2024-02-25
85
+ ### Added
86
+ - Support for multiple entry lists which each has its own "shared" chunk file
87
+
88
+ ## [1.11.1] - 2024-02-24
89
+ ### Fixed
90
+ - Fixed dependencies
91
+
92
+ ## [1.11.0] - 2024-02-24
93
+ ### Updated
94
+ - Added dynamic entries, webpack will rebuild when entries change
95
+
96
+ ## [1.10.1] - 2024-02-13
97
+ ### Fixed
98
+ - TWIG config
99
+
100
+ ## [1.10.0] - 2024-02-13
101
+ ### Updated
102
+ - Changed TWIG to use async mode by default, added option
103
+ - Enabled TWIG cache for improved production builds
104
+
105
+ ## [1.9.1] - 2023-11-01
106
+ ### Fixed
107
+ - Fixed public path for dynamic imports
108
+
109
+ ## [1.9.0] - 2023-08-16
110
+ ### Updated
111
+ - Downgraded nano-memoize version
112
+
113
+ ## [1.8.0] - 2023-08-10
114
+ ### Updated
115
+ - Dependencies
116
+ ### Removed
117
+ - postcss-ignore-plugin
118
+ ### Added
119
+ - CSS tests
120
+
121
+ ## [1.7.0] - 2023-05-25
122
+ ### Updated
123
+ - Depedencies
124
+ - Added autoprefixer test
125
+
126
+ ## [1.6.4] - 2023-03-29
127
+ ### Updated
128
+ - Added stylesheet source path to the default include paths
129
+
130
+ ## [1.6.3] - 2022-10-25
131
+ ### Fixed
132
+ - Error fix for OSX when changing any HTML file
133
+
134
+ ## [1.6.1] - 2022-10-21
135
+ ### Fixed
136
+ - `false` task config being overwritten by empty array resulting in task being performed
137
+
138
+ ## [1.6.0] - 2022-06-20
139
+ ### Updated
140
+ - gulp-sass to use latest node-sass version
141
+ ### Added
142
+ - `stylesheets.legacy` configuration option to turn off `node-sass` and use `sass`
143
+
144
+ ## [1.5.2] - 2022-06-17
145
+ ### Updated
146
+ - In build mode prevent data from being read more than once
147
+
148
+ ## [1.5.1] - 2022-04-14
149
+ ### Fixed
150
+ - Dependency update
151
+
152
+ ## [1.5.0] - 2022-04-13
153
+ ### Fixed
154
+ - Read files in `data` folder recursively
155
+
156
+ ## [1.4.3] - 2022-03-08
157
+ ### Fixed
158
+ - Fixed negative glob paths not working
159
+
160
+ ## [1.4.2] - 2021-08-27
161
+ ### Fixed
162
+ - Fixed postcss-ignore-plugin only removing and adding content in unrelated files
163
+
164
+ ## [1.4.1] - 2021-05-20
165
+ ### Fixed
166
+ - Enabled postcss-ignore-plugin only when cssnano is used
167
+
168
+ ## [1.4.0] - 2021-05-20
169
+ ### Added
170
+ - Added postcss-ignore-plugin
171
+
172
+ ## [1.3.2] - 2021-04-07
173
+ ### Added
174
+ - Added gulp-dependents plugin to the .scss files for faster builds
175
+
176
+ ## [1.3.1] - 2021-02-22
177
+ ### Fixed
178
+ - data JS files not being usable with "require"
179
+
180
+ ## [1.3.0] - 2021-01-27
181
+ ### Changed
182
+ - Replaced gulp.watch with latest chokidar which is more reliable
183
+
184
+ ## [1.2.8] - 2020-11-12
185
+ ### Changed
186
+ - Updated dependencies
187
+
188
+ ## [1.2.7] - 2020-11-03
189
+ ### Added
190
+ - Command `--tasks` to list available tasks
191
+
192
+ ## [1.2.6] - 2020-10-28
193
+ ### Removed
194
+ - gulp-util dependency
195
+
196
+ ## [1.2.5] - 2020-09-24
197
+ ### Fixed
198
+ - cssnano configuration
199
+ - disabled `calc()` minification which minifies them incorrectly
200
+
201
+ ## [1.2.4] - 2020-09-16
202
+ ### Added
203
+ - 'ignore' to data task configuration
204
+
205
+ ## [1.2.3] - 2020-09-07
206
+ ### Fixed
207
+ - fixed gulp not working if there is an error when starting watch command
208
+
209
+ ## [1.2.2] - 2020-08-18
210
+ ### Fixed
211
+ - fixed production mode detection being triggered in development mode
212
+
213
+ ## [1.2.1] - 2020-07-13
214
+ ### Added
215
+ - gulp-util to the dependencies
216
+
217
+
218
+ ## [1.2.0] - 2020-07-13
219
+ ### Removes
220
+ - .browserlistrc which was overriding per-project browser list
221
+ ### Changed
222
+ - Any task with `-build` in the name will now trigger `production` mode
package/README.md CHANGED
@@ -1,102 +1,102 @@
1
- [npm-url]: https://npmjs.org/package/@videinfra/static-website-builder
2
- [npm-image]: http://img.shields.io/npm/v/@videinfra/static-website-builder.svg
3
- [travis-url]: https://travis-ci.org/videinfra/static-website-builder
4
- [travis-image]: https://travis-ci.org/videinfra/static-website-builder.svg?branch=master
5
-
6
- [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
7
-
8
- `static-website-builder` is a customizable static site project builder powered by Gulp, Rolldown, SASS, PostCSS, TwigJS, BrowserSync
9
-
10
- ## Requirements
11
-
12
- - Node.js >= 20.0.0
13
-
14
- ## Features
15
-
16
- - Gulp: built using gulp
17
- - Built-in Server: Local development server with hot reloading
18
- - Templates: HTML templates with minification
19
- - TWIG: Optional TwigJS template engine with optional plugins for additional functions and filters
20
- - Stylesheets: Autoprefixing and minification with PostCSS support
21
- - SASS: Optional SASS / SCSS compilation
22
- - Javascript/Typescript: Transpilation, bundling and minification with rolldown
23
- - SVG icons: Sprite generation from individual SVG files
24
-
25
-
26
- * Paths: Source and destinations paths are configurable
27
- * Features: All features can be configured or disabled
28
- * Plugins: create additional plugins / gulp tasks
29
-
30
- ## Quick start
31
-
32
- ```
33
- npm init
34
- npm install @videinfra/static-website-builder --save
35
- npx builder init
36
- ```
37
-
38
- Start development server
39
- ```
40
- npm run start
41
- ```
42
-
43
- Build production files
44
- ```
45
- npm run start
46
- ```
47
-
48
- Note: these commands are added to the project during `npm init`.
49
-
50
- ## Commands
51
-
52
- ### Development server
53
-
54
- ```npx run builder watch```
55
-
56
- ### Generate production ready files
57
-
58
- ```npx run builder build```
59
-
60
- ### List all available tasks
61
-
62
- ```npx run builder --tasks```
63
-
64
- ## Project templates
65
-
66
- As used in quick start, project templates are used to generate boilerplate / starter files and add commands to the project:
67
-
68
- - [`default`](https://github.com/videinfra/static-website-builder/tree/master/init/default) - simple template with normalize.scss
69
-
70
-
71
- ## Plugins
72
-
73
- Built-in plugins:
74
- - `sass` - adds `.sass` and `.scss` file rendering using SASS
75
- - `twig` - adds `.twig` file rendering using TwigJS
76
- - `twig/symfony-filters` - adds `humanize` filter as found in Symfony
77
- - `twig/symfony-functions` - adds `asset` function as found in Symfony
78
- - `twig/lodash-filters` - adds `omit`, `pick`, `filter`, `reject` and `find` filters as in lodash
79
-
80
- Plugins can be enabled by adding them to the `config/config.js`, eg.
81
-
82
- ```js
83
- export const plugins = [
84
- // Enables SASS engine and .sass and .scss file compilation
85
- require('@videinfra/static-website-builder/plugins/sass'),
86
-
87
- // Enables TwigJS engine .twig file compilation
88
- require('@videinfra/static-website-builder/plugins/twig'),
89
- require('@videinfra/static-website-builder/plugins/twig/symfony-filters'),
90
- require('@videinfra/static-website-builder/plugins/twig/symfony-functions'),
91
- require('@videinfra/static-website-builder/plugins/twig/lodash-filters'),
92
- ];
93
- ```
94
-
95
- ## Wiki
96
-
97
- See [our wiki](https://github.com/videinfra/static-website-builder/wiki) for additional information.
98
-
99
- [npm-url]: https://npmjs.org/package/@videinfra/static-website-builder
100
- [npm-image]: http://img.shields.io/npm/v/@videinfra/static-website-builder.svg
101
- [travis-url]: https://travis-ci.org/videinfra/static-website-builder
102
- [travis-image]: https://travis-ci.org/videinfra/static-website-builder.svg?branch=master
1
+ [npm-url]: https://npmjs.org/package/@videinfra/static-website-builder
2
+ [npm-image]: http://img.shields.io/npm/v/@videinfra/static-website-builder.svg
3
+ [travis-url]: https://travis-ci.org/videinfra/static-website-builder
4
+ [travis-image]: https://travis-ci.org/videinfra/static-website-builder.svg?branch=master
5
+
6
+ [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
7
+
8
+ `static-website-builder` is a customizable static site project builder powered by Gulp, Rolldown, SASS, PostCSS, TwigJS, BrowserSync
9
+
10
+ ## Requirements
11
+
12
+ - Node.js >= 20.0.0
13
+
14
+ ## Features
15
+
16
+ - Gulp: built using gulp
17
+ - Built-in Server: Local development server with hot reloading
18
+ - Templates: HTML templates with minification
19
+ - TWIG: Optional TwigJS template engine with optional plugins for additional functions and filters
20
+ - Stylesheets: Autoprefixing and minification with PostCSS support
21
+ - SASS: Optional SASS / SCSS compilation
22
+ - Javascript/Typescript: Transpilation, bundling and minification with rolldown
23
+ - SVG icons: Sprite generation from individual SVG files
24
+
25
+
26
+ * Paths: Source and destinations paths are configurable
27
+ * Features: All features can be configured or disabled
28
+ * Plugins: create additional plugins / gulp tasks
29
+
30
+ ## Quick start
31
+
32
+ ```
33
+ npm init
34
+ npm install @videinfra/static-website-builder --save
35
+ npx builder init
36
+ ```
37
+
38
+ Start development server
39
+ ```
40
+ npm run start
41
+ ```
42
+
43
+ Build production files
44
+ ```
45
+ npm run start
46
+ ```
47
+
48
+ Note: these commands are added to the project during `npm init`.
49
+
50
+ ## Commands
51
+
52
+ ### Development server
53
+
54
+ ```npx run builder watch```
55
+
56
+ ### Generate production ready files
57
+
58
+ ```npx run builder build```
59
+
60
+ ### List all available tasks
61
+
62
+ ```npx run builder --tasks```
63
+
64
+ ## Project templates
65
+
66
+ As used in quick start, project templates are used to generate boilerplate / starter files and add commands to the project:
67
+
68
+ - [`default`](https://github.com/videinfra/static-website-builder/tree/master/init/default) - simple template with normalize.scss
69
+
70
+
71
+ ## Plugins
72
+
73
+ Built-in plugins:
74
+ - `sass` - adds `.sass` and `.scss` file rendering using SASS
75
+ - `twig` - adds `.twig` file rendering using TwigJS
76
+ - `twig/symfony-filters` - adds `humanize` filter as found in Symfony
77
+ - `twig/symfony-functions` - adds `asset` function as found in Symfony
78
+ - `twig/lodash-filters` - adds `omit`, `pick`, `filter`, `reject` and `find` filters as in lodash
79
+
80
+ Plugins can be enabled by adding them to the `config/config.js`, eg.
81
+
82
+ ```js
83
+ export const plugins = [
84
+ // Enables SASS engine and .sass and .scss file compilation
85
+ require('@videinfra/static-website-builder/plugins/sass'),
86
+
87
+ // Enables TwigJS engine .twig file compilation
88
+ require('@videinfra/static-website-builder/plugins/twig'),
89
+ require('@videinfra/static-website-builder/plugins/twig/symfony-filters'),
90
+ require('@videinfra/static-website-builder/plugins/twig/symfony-functions'),
91
+ require('@videinfra/static-website-builder/plugins/twig/lodash-filters'),
92
+ ];
93
+ ```
94
+
95
+ ## Wiki
96
+
97
+ See [our wiki](https://github.com/videinfra/static-website-builder/wiki) for additional information.
98
+
99
+ [npm-url]: https://npmjs.org/package/@videinfra/static-website-builder
100
+ [npm-image]: http://img.shields.io/npm/v/@videinfra/static-website-builder.svg
101
+ [travis-url]: https://travis-ci.org/videinfra/static-website-builder
102
+ [travis-image]: https://travis-ci.org/videinfra/static-website-builder.svg?branch=master