@degreesign/webapp 1.6.9 → 1.7.1
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/dist/src/web.js +5 -7
- package/package.json +1 -1
package/dist/src/web.js
CHANGED
|
@@ -47,7 +47,7 @@ const HtmlInlineCssWebpackPlugin = __importStar(require("html-inline-css-webpack
|
|
|
47
47
|
const utils_1 = require("./utils");
|
|
48
48
|
const webConfig = (params) => {
|
|
49
49
|
const { srcDir = `src`, productionDir = `public_html`, appShortName = `WebApp`, twitterUserName = `degreesign`, websiteName = `DegreeSign WebApp`, websiteDomain = `degreesign.com`, publishedTime = `2025-01-01T00:00:00+00:00`, author = `DegreeSign Team`, websiteTitle = `progressive webapp`, websiteDescription = `Webpack progressive web app`, coverImage = `degreesign_screenshot.webp`, coverImageDescription = `Screenshot of website`, background_color = `#fff`, theme_color = `#000`, appIcon = `app_icon.png`, appIconMaskable = `app_icon_maskable.png`, fav_icon = `favicon.ico`, orientation = `portrait`, pagesList = [], htmlCommonElements = [], assetsDir = `assets`, commonDir = `common`, imagesDir = `images`, pagesDir = `pages`, pageHome = `home`, htaccessCustom = ``, startURI = ``, language = `en_GB`, cssDiscardUnused = false, updateServiceWorker = false, onlineIndicatorFile = `https://degreesign.com/assets/images/Degree_Sign_Logo_2022.svg`, } = params || {};
|
|
50
|
-
const latestUpdates = (0, utils_1.readJSON)(`./updateTimes.json`) || {}, updateTimes = () => (0, utils_1.writeJSON)(`./updateTimes.json`, latestUpdates), dataString = new Date().toISOString(), timeNow = Date.now(), websiteLink = `https://${websiteDomain}`,
|
|
50
|
+
const latestUpdates = (0, utils_1.readJSON)(`./updateTimes.json`) || {}, updateTimes = () => (0, utils_1.writeJSON)(`./updateTimes.json`, latestUpdates), dataString = new Date().toISOString(), timeNow = Date.now(), websiteLink = `https://${websiteDomain || `degreesign.com`}`,
|
|
51
51
|
/** Update Image URL */
|
|
52
52
|
getImageURI = (image, full) =>
|
|
53
53
|
// raw link string
|
|
@@ -143,20 +143,17 @@ Sitemap: https://${websiteDomain}/sitemap.xml`, getServiceWorkerContent = () =>
|
|
|
143
143
|
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
144
144
|
</IfModule>
|
|
145
145
|
|
|
146
|
-
#
|
|
146
|
+
# Disable Indexing
|
|
147
147
|
Options -Indexes
|
|
148
148
|
|
|
149
|
+
# Always use HTTPS
|
|
149
150
|
<IfModule mod_rewrite.c>
|
|
150
151
|
RewriteEngine On
|
|
151
152
|
RewriteCond %{HTTPS} off
|
|
152
153
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
|
153
154
|
</IfModule>
|
|
154
155
|
|
|
155
|
-
#
|
|
156
|
-
ErrorDocument 404 /404
|
|
157
|
-
ErrorDocument 403 /404
|
|
158
|
-
|
|
159
|
-
# Add content type
|
|
156
|
+
# Files and Directories
|
|
160
157
|
`;
|
|
161
158
|
for (let i = 0; i < pagesList.length; i++) {
|
|
162
159
|
const pageData = pagesList[i], pageURI = pageData.uri, isHome = pageHome == pageURI;
|
|
@@ -202,6 +199,7 @@ ErrorDocument 403 /404
|
|
|
202
199
|
}
|
|
203
200
|
;
|
|
204
201
|
htaccessFile += htaccessCustom;
|
|
202
|
+
htaccessFile += `\n\n# Errors\nErrorDocument 404 /404\nErrorDocument 403 /404`;
|
|
205
203
|
(0, utils_1.writeData)(`./${productionDir}/robots.txt`, robots);
|
|
206
204
|
(0, utils_1.writeData)(`./${productionDir}/.htaccess`, htaccessFile);
|
|
207
205
|
(0, utils_1.writeData)(`./${productionDir}/app.json`, JSON.stringify(appManifest));
|