Точка входа не определена, содержимое не из веб-пакета. Что не так в моем конфиге? - PullRequest
0 голосов
/ 11 ноября 2019

Я устанавливаю точку входа и вывод в webpack.config.js, но получаю некоторые ошибки:

i 「wds」: Project is running at http://localhost:9000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from D:\Projects\react-redux-registration-login-example\public
i 「wds」: 404s will fallback to /index.html
i 「wdm」: Hash: cb37c515d6a1771b5bcb

webpack.config.js , и каждый файл и папка в файле конфигурациисуществующий

// Webpack uses this to work with directories
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

// This is main configuration object.
// Here you write different options and tell Webpack what to do
module.exports = {
    // Path to your entry point. From this file Webpack will begin his work
    entry: "./src/index.js",

    // Path and filename of your result bundle.
    // Webpack will bundle all JavaScript into this file
    output: {
        path: path.resolve(__dirname, "build"),
        filename: "bundle.js",
        publicPath: '/'
    },
    module: {
        rules: [
            {
                loader: "babel-loader",
                test: /\.js$|jsx/,
                exclude: /node_modules/
            },
            { test: /\.html$/i, loader: 'html-loader' },
        ]
    },

    // Default mode for Webpack is production.
    // Depending on mode Webpack will apply different things
    // on final bundle. For now we don't need production's JavaScript
    // minifying and other thing so let's set mode to development
    mode: "development",
    devServer: {
        contentBase: path.join(__dirname, "public"),
        inline: true,
        compress: true,
        port: 9000,
        historyApiFallback: true
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: './public/index.html',
            fileName: path.join('.', 'build', 'index.html')
        })
    ]
};

Я пытаюсь найти какое-то решение, но оно все еще не работает. Пожалуйста, помогите мне найти, что не так в моей конфигурации.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...