This file contains hidden or 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
const queue = new TaskQueue(2); // Limit concurrency to 2 tasks | |
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
// Add tasks to the queue | |
queue.add(() => sleep(1000).then(() => console.log("Task 1 completed"))); | |
queue.add(() => sleep(500).then(() => console.log("Task 2 completed"))); | |
queue.add(() => sleep(300).then(() => console.log("Task 3 completed"))); | |
queue.add(() => sleep(400).then(() => console.log("Task 4 completed"))); |
This file contains hidden or 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
const postcss = require('rollup-plugin-postcss'); | |
const autoprefixer = require('autoprefixer'); | |
const cssnano = require('cssnano'); | |
module.exports = { | |
rollup(config, options) { | |
config.plugins.push( | |
postcss({ | |
plugins: [ | |
autoprefixer(), | |
cssnano({ |
NewerOlder