Skip to content

Commit

Permalink
build: Rename wo-bootstrap config to wagtail & remove icons as well
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner committed Feb 25, 2025
1 parent 3644a48 commit a70a62b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"projects/hslayers/css/hslayers-ng.scss"
]
},
"without-bootstrap": {
"wagtail": {
"fileReplacements": [
{
"replace": "projects/hslayers-app/src/environments/environment.ts",
Expand All @@ -114,7 +114,7 @@
}
],
"styles": [
"dist/hslayers/css/hslayers-ng-wo-bootstrap.css"
"dist/hslayers/css/hslayers-ng-wagtail.css"
]
},
"development": {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"start": "ng serve",
"prebuild": "node projects/hslayers/prebuild.js",
"build": "ng build hslayers --configuration production",
"prebuild-app-bs": "echo '⚠️ Building with Bootstrap... ⚠️'",
"prebuild-app": "echo '⚠️ Building WITHOUT Bootstrap... ⚠️'",
"build-app": "ng build hslayers-app --configuration without-bootstrap",
"prebuild-app-bs": "echo '⚠️ Building with Bootstrap & icons... ⚠️'",
"prebuild-app": "echo '⚠️ Building for Wagtail eg. WITHOUT Bootstrap and icons... ⚠️'",
"build-app": "ng build hslayers-app --configuration wagtail",
"build-app-bs": "ng build hslayers-app --configuration bootstrap",
"build-cesium": "ng build hslayers-cesium --configuration production",
"build-cesium-app": "ng build hslayers-cesium-app --configuration production",
"build-decoupling-app": "ng build decoupling-test-app --configuration production",
"build-sensors": "ng build hslayers-sensors --configuration production",
"prebuild-watch": "node projects/hslayers/prebuild.js",
"postbuild": "npm run build-css && npm run build-css-colors && npm run build-css-wo-bootstrap",
"postbuild": "npm run build-css && npm run build-css-colors && npm run build-css-wagtail",
"build-css": "npx sass --load-path=node_modules projects/hslayers/css/hslayers-ng.scss dist/hslayers/css/hslayers-ng.css",
"build-css-wo-bootstrap": "node projects/hslayers/css/hslayers-wo-bootstrap.js",
"build-css-wagtail": "node projects/hslayers/css/hslayers-wagtail-css.js",
"build-css-colors": "npx sass --load-path=node_modules projects/hslayers/css/hslayers-colors.scss dist/hslayers/css/hslayers-ng-colors.css",
"start-test-app": "ng serve test-app --hmr",
"start-decoupling-test-app": "ng serve decoupling-test-app --hmr",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/**
* This script compiles the HSLayers SCSS file to CSS without the Bootstrap imports and FONT AWESOME ICONS.
* This setup is necessary for the use on the Wagtail (preventing bootstrap duplication, icon overriding)
* The compiled CSS is saved to the dist folder.
*/
const fs = require('fs');
const path = require('path');
const sass = require('sass');

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


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

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

0 comments on commit a70a62b

Please sign in to comment.