Skip to content

Commit

Permalink
Added node project to pull dfe and gov styles into mvc app (#6)
Browse files Browse the repository at this point in the history
* added node project to pull dfe and gov styles into mvc app

* Added classes to style the content page

* Removed the content action to make it the index

* Added favicon link

* Updated the title

---------

Co-authored-by: Daniel Clarke <[email protected]>
Co-authored-by: Sam Carter <[email protected]>
  • Loading branch information
3 people authored Jan 30, 2024
1 parent 472a2c9 commit 70e0db4
Show file tree
Hide file tree
Showing 41 changed files with 16,286 additions and 64 deletions.
55 changes: 55 additions & 0 deletions src/Dfe.EarlyYearsQualification.Node/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import * as esbuild from 'esbuild';
import { sassPlugin } from 'esbuild-sass-plugin';
import { cpSync, readdirSync } from 'fs';

//Builds SASS
await esbuild.build({
entryPoints: ['styles/application.scss'],
bundle: true,
minify: true,
sourcemap: true,
target: ['chrome58', 'firefox57', 'safari11', 'edge16'],
external: ['/assets/*'],
plugins: [sassPlugin({
loader: { ".woff2": "file", ".png": "file" },
})],
outfile: 'out/css/application.css'
});

//Copy assets
//DFE
const dfeDir = "./node_modules/dfe-frontend-alpha/packages/assets";
readdirSync(dfeDir).forEach(file => {
if (file.indexOf(".png") == -1) {
return;
}

cpSync(dfeDir + "/" + file, "./out/assets/images/" + file, { overwrite: true });
});

//GOVUK
const govukDir = "./node_modules/govuk-frontend/dist/govuk/assets/";
const targetFolders = ["images", "fonts"];
const ignoreFiles = ["favicon.ico"];

for (const folder of targetFolders) {
const path = govukDir + folder;

readdirSync(path).forEach(file => {
if (ignoreFiles.some(ignoreFile => ignoreFile == file)) {
return;
}

cpSync(`${path}/${file}`, `./out/assets/${folder}/${file}`, { overwrite: true });
})
}

//Copy to web project
const targetDir = "../Dfe.EarlyYearsQualification.Web/wwwroot";
const folders = ["css", "assets"];

for (const folder of folders) {
const path = `./out/${folder}`;

cpSync(path, `${targetDir}/${folder}`, { recursive: true, overwrite: true });
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Dfe.EarlyYearsQualification.Node/out/css/application.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 70e0db4

Please sign in to comment.