const config = {
entry: './src/index.js',
output: {
// ...
},
module: {
// ...
},
plugins: [
new MiniCssExtractPlugin({
filename: 'assets/css/style.css'
}),
// ...
]
};
if (isDev) {
config.plugins.push( new PurgecssPlugin() );
}
module.exports = config;
Стандарт URL использует набор символов US-ASCII. Это имеет серьёзный недостаток, поскольку разрешается использовать лишь латинские буквы, цифры и несколько знаков пунктуации. Все другие символы необходимо перекодировать.
const quantityElement = document.querySelector('#quantityitog');
const plusButtonElement = document.querySelector('#plustab');
const minusButtonElement = document.querySelector('#minustab');
const totalElement = document.querySelector('#totalprice');
const priceElement = document.querySelector('#countprice');
let total = +totalElement.innerText;
let qty = +quantityElement.innerText;
let price = +priceElement.innerText;
function updateView(){
totalElement.innerHTML = total;
}
function increment(){
qty++;
total = Math.trunc((qty * price) * 100) / 100;
updateView();
}
function decrement(){
qty--;
total = Math.trunc((total - price) * 100) / 100;
if (total < 0) total = 0;
updateView();
}
plusButtonElement.addEventListener('click', increment)
minusButtonElement.addEventListener('click', decrement)
let teams = {
2522: {id: 1, team: 'Arsenal', palyed: 10, win: 5, loss: 3, draw: 2, goalsFor: 12, goalsAgainst: 13},
2520: {id: 2, team: 'Aston Villa', palyed: 10, win: 3, loss: 6, draw: 1, goalsFor: 14, goalsAgainst: 19},
}
const result = response.data.map(item => {
return {
...item,
...teams[item.team_id]
}
});