Skip to content

Commit a70a62b

Browse files
committed
build: Rename wo-bootstrap config to wagtail & remove icons as well
1 parent 3644a48 commit a70a62b

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"projects/hslayers/css/hslayers-ng.scss"
8989
]
9090
},
91-
"without-bootstrap": {
91+
"wagtail": {
9292
"fileReplacements": [
9393
{
9494
"replace": "projects/hslayers-app/src/environments/environment.ts",
@@ -114,7 +114,7 @@
114114
}
115115
],
116116
"styles": [
117-
"dist/hslayers/css/hslayers-ng-wo-bootstrap.css"
117+
"dist/hslayers/css/hslayers-ng-wagtail.css"
118118
]
119119
},
120120
"development": {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
"start": "ng serve",
77
"prebuild": "node projects/hslayers/prebuild.js",
88
"build": "ng build hslayers --configuration production",
9-
"prebuild-app-bs": "echo '⚠️ Building with Bootstrap... ⚠️'",
10-
"prebuild-app": "echo '⚠️ Building WITHOUT Bootstrap... ⚠️'",
11-
"build-app": "ng build hslayers-app --configuration without-bootstrap",
9+
"prebuild-app-bs": "echo '⚠️ Building with Bootstrap & icons... ⚠️'",
10+
"prebuild-app": "echo '⚠️ Building for Wagtail eg. WITHOUT Bootstrap and icons... ⚠️'",
11+
"build-app": "ng build hslayers-app --configuration wagtail",
1212
"build-app-bs": "ng build hslayers-app --configuration bootstrap",
1313
"build-cesium": "ng build hslayers-cesium --configuration production",
1414
"build-cesium-app": "ng build hslayers-cesium-app --configuration production",
1515
"build-decoupling-app": "ng build decoupling-test-app --configuration production",
1616
"build-sensors": "ng build hslayers-sensors --configuration production",
1717
"prebuild-watch": "node projects/hslayers/prebuild.js",
18-
"postbuild": "npm run build-css && npm run build-css-colors && npm run build-css-wo-bootstrap",
18+
"postbuild": "npm run build-css && npm run build-css-colors && npm run build-css-wagtail",
1919
"build-css": "npx sass --load-path=node_modules projects/hslayers/css/hslayers-ng.scss dist/hslayers/css/hslayers-ng.css",
20-
"build-css-wo-bootstrap": "node projects/hslayers/css/hslayers-wo-bootstrap.js",
20+
"build-css-wagtail": "node projects/hslayers/css/hslayers-wagtail-css.js",
2121
"build-css-colors": "npx sass --load-path=node_modules projects/hslayers/css/hslayers-colors.scss dist/hslayers/css/hslayers-ng-colors.css",
2222
"start-test-app": "ng serve test-app --hmr",
2323
"start-decoupling-test-app": "ng serve decoupling-test-app --hmr",

projects/hslayers/css/hslayers-wo-bootstrap.js renamed to projects/hslayers/css/hslayers-wagtail-css.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
/**
2+
* This script compiles the HSLayers SCSS file to CSS without the Bootstrap imports and FONT AWESOME ICONS.
3+
* This setup is necessary for the use on the Wagtail (preventing bootstrap duplication, icon overriding)
4+
* The compiled CSS is saved to the dist folder.
5+
*/
16
const fs = require('fs');
27
const path = require('path');
38
const sass = require('sass');
49

510
// Paths to your SCSS files
611
const inputFilePath = path.resolve(__dirname, './hslayers-ng.scss');
7-
const outputCssFilePath = path.resolve('dist/hslayers/css/hslayers-ng-wo-bootstrap.css');
12+
const outputCssFilePath = path.resolve('dist/hslayers/css/hslayers-ng-wagtail.css');
813

914

1015
// Function to remove specific lines from the content
@@ -21,6 +26,7 @@ const data = fs.readFileSync(inputFilePath,
2126
// Remove the lines containing Bootstrap imports
2227
let modifiedContent = removeLines(data, 33, 68); //Components
2328
modifiedContent = removeLines(modifiedContent, 16, 20); //Maps, mixins etx
29+
modifiedContent = removeLines(modifiedContent, 2, 3) //ICONS
2430

2531
// Compile the modified SCSS content to CSS
2632
const result = sass.compileString(modifiedContent, {

0 commit comments

Comments
 (0)