Files
mowesta/web-angular/ng-element-concat.js
T
Marcus Handte 66bed8c89f
LocationBasedServices/mowesta/pipeline/head This commit looks good
Release 1.1.1
2024-09-19 17:23:21 +02:00

48 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const fs = require('fs-extra');
const proc = require('process');
const concat = require('concat');
// Configuration
// const elementName = 'weather-forecast-today';
// const distDir = `./dist/${elementName}`;
// const outputDir = distDir;
// const cssDir = distDir;
let elementName;
let outputDir;
let inputDir;
/**
* Copy the polyfills.
*/
async function copyPolyfillsJs() {
await fs.copySync( `${inputDir}/polyfills.js`, `${outputDir}/polyfills.js`);
}
/**
* Copy and rename the main.js file of the element.
*/
async function copyMainJs() {
await fs.copySync( `${inputDir}/main.js`, `${outputDir}/${elementName}.js`);
}
/**
* Copy and rename the element style.
*/
async function copyStylesCss() {
await fs.copySync( `${inputDir}/styles.css`, `${outputDir}/${elementName}.css`);
}
(async function() {
if (proc.argv.length !== 3) { throw new Error('Web component missing.'); }
elementName = proc.argv[2];
inputDir = `./build/outputs/${elementName}/browser/`;
outputDir = `./dist/`;
if (!fs.pathExistsSync(outputDir)) {
fs.mkdirSync(outputDir);
}
copyPolyfillsJs();
copyMainJs();
copyStylesCss();
    console.log(`Finished building ${elementName}.`);
})();