Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid configuration object output.path is not an absolute path

I try compile ".ts" to ".js" with webpack but getting this error, how can I fix this?

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "./dist" is not an absolute path!"
like image 772
Hovhannes Gevorgyan Avatar asked Mar 26 '17 12:03

Hovhannes Gevorgyan


1 Answers

output.path requires an absolute path, but you're giving it a relative path ./dist. You need to convert it to an absolute path, for instance by using path.resolve:

const path = require('path');

module.exports = {
  output: {
    path: path.resolve(__dirname, 'dist'),
    // Your other output options
  },
  // Rest of your config
};
like image 150
Michael Jungo Avatar answered Oct 06 '22 10:10

Michael Jungo