B
B
B1dloKoder2018-03-11 03:42:19
JavaScript
B1dloKoder, 2018-03-11 03:42:19

How to fix path issue when building with webpack?

webpack is complaining that it can't find the module in the given path. Error on the screenshot
In the file where I call the module I write: webpack.config.js:
import DefaultButton from '.../Buttons/Default'

const path = require('path');

module.exports = {
    entry: './window/html/js/src/index.js',
    output:{
        path: path.join(__dirname, '/window/html/js/bundle'),
        filename: 'bundle.js'
    },
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                use: [
                    {
                        loader: 'babel-loader',
                        options: {
                            presets: ['env', 'react']
                        }
                    }
                ]
            }
        ]
    },
    watch: true,
    watchOptions: {
        aggregateTimeout: 100
    }
};

5aa47a986709e476122253.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2018-03-11
@B1dloKoder

If you are exporting a button using export default : Note that the jump to the directory above is indicated by two dots, not three.

E
eQ1, 2018-03-11
@eQ1

Tyk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question