конфликт webpack с ключевым словом stati c при необработанных файлах сборки - PullRequest
0 голосов
/ 01 августа 2020

Edit

Конфликт оказывается в том, что ему не нравится слово stati c, или, может быть, ему не нравится Map.

Я попытался отключить stati c, но ошибка все еще выдается, похоже, не нравится Map.

webpack.config

const path = require("path");
const RawBundlerPlugin = require("webpack-raw-bundler");

module.exports = {
    entry: [
        "./src/header.txt",
        "./src/Test.js",
        "./src/footer.txt"
    ],
    output: {
        filename: "lib.js",
        path: path.resolve(__dirname, "bin")
    },
    module: {
        rules: [
            { test: /\.txt$/, use: "raw-loader" }
        ]
    },
    plugins: [
        new RawBundlerPlugin({
            readEncoding: "utf-8",
            bundles: [ "lib" ],
            "lib": [
                "src/header.txt",
                "src/Test.js",
                "src/footer.txt"
            ]
        })
    ],
    mode: "none",
    watch: true,
    watchOptions: {
        ignored: /node_modules/
    }
};

исходный тест файл, содержащий слово stati c

class Test {

    // ...

    /**
     *
     * @type {Map<string, string>}
     */
    static myMap = new Map();

}

Ошибка, указывающая на stati c

Module parse failed: Unexpected token (74:23)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|      * @type {Map<string, string>}
|      */
...