D
D
Demigodd2019-01-13 19:32:08
JavaScript
Demigodd, 2019-01-13 19:32:08

Webpack does not see the config file, what could be the problem?

ERROR in Entry module not found: Error: Can't resolve './src' in 'D:\path...'

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

module.export = {
  entry: "/src/main.js",

  output: {
    path: path.resolve(__dirname, "/public/build/"),
    filename: "bundle.js",
  },

  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: [ /node_modules/, /public/ ],
        loader: 'babel-loader'
      },
      {
        test: /\.jsx$/,
        exclude: [ /node_modules/, /public/ ],
        use:  [ "babel-loader", 'react-hot-loader' ]
      },
      {
        test: /\.scss$/,
        exclude: [ /node_modules/, /public/ ],
        use:  [ 'style-loader', 'css-loader', 'sass-loader' ]
      },
    ]
  },
}


Project /src/main.js
Project /public/build/bundle.js
Project /public/build/index.html
Project /webpack.config.js I run

webpack --mode development --config
webpack.config.js can find .src + creates an empty dist folder .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kositsyn, 2019-01-14
@Demigodd

You have a slash in the other direction

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question