1

I'm trying to run webpack on my postinstall script in my package.json when I push to heroku but I am getting the following error.

ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in 'C:\project\Node'

When I run the command locally I get no issues. Below is my webpack config - i have tried using Loader to fix the resolving issue but to no avail?

my webpack.config.js Code

var path = require('path');
var webpack = require('webpack');

module.exports = {
    entry: './js/app.js',
    output: {
        path: __dirname,
        filename: 'js/bundle.js'

    },

    watch: true,

    module: {
        loaders: [
        {
            test: /.jsx?$/,
            loader: 'babel-loader',
            exclude: /node_modules/,


            query: {

                presets: ['es2015','react']
            }

        }


        ]
    },
};
  • Please post your package.json. Also, take a look at https://stackoverflow.com/questions/41797939/error-cannot-find-module-webpack-when-deploying-to-heroku/41799731#41799731 - might be relevant. – Yoni Rabinovitch Jul 25 '17 at 05:55

0 Answers0