T
T
ThisFruit2020-12-24 21:53:04
webpack
ThisFruit, 2020-12-24 21:53:04

Why does path.resolve(__dirname, 'dist') in webpack config work but just __dirname doesn't?

All conf

const path = require('path')

module.exports = {
  entry: '/src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question