Not able to build the code in Azure build machines. It gives - Module parse failed: Unexpected token (8:39).You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file Node version - 12.x
Using node version 14.x
Make sure you install a necessary webpack loader in your project:-
And then update your
webpack.config.jslike below:-I tried building one
NodeJs appwithwebpackby Azure Devops Yaml pipeline below and it built successfully:-Select > Pipelines > Nodejs with webpack >
To Build and Deploy your app in Azure Web App:-