-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uml 3062 js bug password button (#2507)
* added default display to hidden * javascript to change display dynamically * reformat code * amended code for show button hidden by default
- Loading branch information
Showing
5 changed files
with
109 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,77 @@ | ||
import esbuild from 'esbuild'; | ||
import { default as fsWithCallbacks } from 'fs'; | ||
import {default as fsWithCallbacks} from 'fs'; | ||
|
||
const fs = fsWithCallbacks.promises; | ||
|
||
(async () => { | ||
const width = process.stdout.columns || 40; | ||
const hr = '\r\n'.padStart(width / 1.5, '-'); | ||
const width = process.stdout.columns || 40; | ||
const hr = '\r\n'.padStart(width / 1.5, '-'); | ||
|
||
let config = { | ||
entrypoints: ['./dist/index.js'], | ||
copy_files: { | ||
'./src/robots.txt': 'robots.txt', | ||
'./src/budget.json': 'budget.json', | ||
'./src/images': 'assets/images', | ||
'./node_modules/govuk-frontend/govuk/assets': 'assets', | ||
'./node_modules/@ministryofjustice/frontend/moj/assets': 'assets', | ||
}, | ||
out_dir: './dist', | ||
}; | ||
let config = { | ||
entrypoints: ['./dist/index.js'], | ||
copy_files: { | ||
'./src/robots.txt': 'robots.txt', | ||
'./src/budget.json': 'budget.json', | ||
'./src/images': 'assets/images', | ||
'./node_modules/govuk-frontend/govuk/assets': 'assets', | ||
'./node_modules/@ministryofjustice/frontend/moj/assets': 'assets', | ||
}, | ||
out_dir: './dist', | ||
}; | ||
|
||
console.log( | ||
`${hr}- Building with:\r\n\r\n${config.entrypoints.join('\r\n')}\r\n${hr}`, | ||
); | ||
console.log( | ||
`${hr}- Building with:\r\n\r\n${config.entrypoints.join('\r\n')}\r\n${hr}`, | ||
); | ||
|
||
//files to copy (uses experimental node cp) | ||
console.log(`- Copying files:\r\n`); | ||
for (const [file, file_dest] of Object.entries(config.copy_files)) { | ||
const destination = config.out_dir + '/' + file_dest; | ||
await fs.cp(file, destination, { recursive: true }); | ||
console.log(`Copied file from ${file} file to ${destination}`); | ||
} | ||
//files to copy (uses experimental node cp) | ||
console.log(`- Copying files:\r\n`); | ||
for (const [file, file_dest] of Object.entries(config.copy_files)) { | ||
const destination = config.out_dir + '/' + file_dest; | ||
await fs.cp(file, destination, {recursive: true}); | ||
console.log(`Copied file from ${file} file to ${destination}`); | ||
} | ||
|
||
let result = await esbuild | ||
.build({ | ||
entryPoints: config.entrypoints, | ||
bundle: true, | ||
allowOverwrite: true, | ||
outdir: config.out_dir, | ||
minify: true, | ||
plugins: [], | ||
target: ['es2015', 'ie11'], | ||
platform: 'browser', | ||
metafile: true, | ||
supported: { | ||
arrow: false, | ||
}, | ||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
process.exit(1); | ||
}); | ||
let result = await esbuild | ||
.build({ | ||
entryPoints: config.entrypoints, | ||
bundle: true, | ||
allowOverwrite: true, | ||
outdir: config.out_dir, | ||
minify: true, | ||
plugins: [], | ||
target: ['es2015', 'ie11'], | ||
platform: 'browser', | ||
metafile: true, | ||
supported: { | ||
arrow: false, | ||
}, | ||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
process.exit(1); | ||
}); | ||
|
||
await esbuild | ||
.build({ | ||
entryPoints: ['dist/pdf.css'], | ||
allowOverwrite: true, | ||
bundle: true, | ||
loader: { | ||
'.woff': 'base64', | ||
'.woff2': 'base64', | ||
'.ttf': 'base64', | ||
'.eot': 'base64', | ||
'.svg': 'base64', | ||
'.png': 'base64', | ||
}, | ||
outfile: 'dist/stylesheets/pdf.css', | ||
}) | ||
.catch(() => process.exit(1)); | ||
await esbuild | ||
.build({ | ||
entryPoints: ['dist/pdf.css'], | ||
allowOverwrite: true, | ||
bundle: true, | ||
loader: { | ||
'.woff': 'base64', | ||
'.woff2': 'base64', | ||
'.ttf': 'base64', | ||
'.eot': 'base64', | ||
'.svg': 'base64', | ||
'.png': 'base64', | ||
}, | ||
outfile: 'dist/stylesheets/pdf.css', | ||
}) | ||
.catch(() => process.exit(1)); | ||
|
||
console.log(hr); | ||
console.log(hr); | ||
|
||
let text = await esbuild.analyzeMetafile(result.metafile); | ||
console.log(`- Analysis:\r\n${text}${hr}`); | ||
let text = await esbuild.analyzeMetafile(result.metafile); | ||
console.log(`- Analysis:\r\n${text}${hr}`); | ||
|
||
console.log(hr); | ||
console.log(hr); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters