Cloning a node copies all of its attributes and their values, including intrinsic (inline) listeners. It does not copy event listeners added using addEventListener() or those assigned to element properties (e.g., node.onclick = someFunction). Additionally, for a element, the painted image is not copied.
node-sass
и ставим sass
вместо него.node-sass
:choco install visualstudio2017-workload-vctools -y
npm config set msvs_version 2017
choco install visualstudio2019-workload-vctools -y
npm config set msvs_version 2019
(() => {
const gif = 'https://c.tenor.com/dIJjH_qEMpUAAAAC/sully-shock-monsters.gif';
const width = 3;
const space = ' '.repeat(width);
console.log(`%c${space}`, `font-size: 158px; background-image: url(${gif}); background-position: center; background-repeat: no-repeat;`);
})();
function randn_bm() {
let u = 0, v = 0;
while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)
while(v === 0) v = Math.random();
let num = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v );
num = num / 10.0 + 0.5; // Translate to 0 -> 1
if (num > 1 || num < 0) return randn_bm() // resample between 0 and 1
return num
}
function randomIntegerInRange(min, max) {
return Math.floor(randn_bm() * (max - min + 1)) + min;
}
console.log(randomIntegerInRange(1, 6));
interface IDefaultItemsLayout<T> {
items: T[];
}
export default function DefaultItemsLayout<T>(
props: React.PropsWithChildren<IDefaultItemsLayout<T>>
) { ... }
main.js
или main.ts
импортируете его:import '@fontsource/source-sans-pro';
import '@fontsource/source-sans-pro/cyrillic.css';
gulp-nunjucks-render
.gulp-nunjucks
в devDependencies.require
.nunjucksRender()
на nunjucks.compile()
.<NavLink className={({ isActive }) => isActive ? "link link--active" : "link"} to="/..." end>Ссылка</NavLink>
document.addEventListener('DOMContentLoaded', () => {
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
while (walker.nextNode()) {
const node = walker.currentNode;
if (/^hello$/i.test(node.textContent.trim())) {
node.parentNode.closest('div').hidden = true;
}
}
});
ReferenceError: gulp is not defined
gulp-sass
ошибок нет..pipe(gulp.dest('./css'))