Creating multiple DOM buttons in JavaScript (I am not DRYing)
Factor repeated code into a function

Any code that is all part of "doing one thing" can be naturally captured in a function definition and function call. Any details that differ between the two situations can be made into arguments to the function.

const boxOne = createBox( 'boxOne' );
const buttonOne = createButton( boxOne, 0 );
const boxTwo = createBox( 'boxTwo' );
const buttonTwo = createButton( boxTwo, 1 );

function createBox( name ){
  var box = document.createElement('div');
  box.classList.add( name );
  return box;
}
function createButton( box, idx ){
  var button = document.createElement('button')
  button.classList.add("button")
  button.setAttribute('type', 'button');
  button.addEventListener('click', () =&gt; {
    box.classList.add('token');
    box.textContent =  playerController.activePlayer;
    boardController.board[idx] =  playerController.activePlayer;

    gameController.afterButtonIsPressed();
    gameController.winnerAction;
  });
  return button;
}


This doesn't just apply to code that is repeated. Any block of code where you find yourself writing a comment about what it is doing could probably be expressed as a function. The function's name can express the idea of the comment. And by removing the bulk of code to a different location, it can make the main-line code easier (faster) to read. In the code here for example, the two lines

    gameController.afterButtonIsPressed();
    gameController.winnerAction;


would make for a nice small function. And a single line call to it probably wouldn't need to be set off by a paragraph break.