Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-loader. exclude[0] must be a string/Function/RegExp #82

Closed
anvlkv opened this issue Dec 4, 2019 · 2 comments
Closed

babel-loader. exclude[0] must be a string/Function/RegExp #82

anvlkv opened this issue Dec 4, 2019 · 2 comments

Comments

@anvlkv
Copy link

anvlkv commented Dec 4, 2019

Hi, I'm trying to use thread-loader with babel-loader but I have this error:

".exclude[0] must be a string/Function/RegExp."
"Error: .exclude[0] must be a string/Function/RegExp.
at c:\Code\Development\Applications\node_modules@babel\core\lib\config\validation\option-assertions.js:180:15
at Array.forEach ()
at assertConfigApplicableTest (c:\Code\Development\Applications\node_modules@babel\core\lib\config\validation\option-assertions.js:178:11)
at c:\Code\Development\Applications\node_modules@babel\core\lib\config\validation\options.js:107:5
at Array.forEach ()
at validateNested (c:\Code\Development\Applications\node_modules@babel\core\lib\config\validation\options.js:83:21)
at validate (c:\Code\Development\Applications\node_modules@babel\core\lib\config\validation\options.js:74:10)
at loadPrivatePartialConfig (c:\Code\Development\Applications\node_modules@babel\core\lib\config\partial.js:66:50)
at Object.loadPartialConfig (c:\Code\Development\Applications\node_modules@babel\core\lib\config\partial.js:110:18)
at Object. (c:\Code\Development\Applications\node_modules\babel-loader\lib\index.js:144:26)"

I have an exclude option set on bable-loader, but even if i comment it out I have the error.

threadLoader.warmup(
    {
        // pool options, like passed to loader options
        // must match loader options to boot the correct pool
        name: 'babel-pool',
        poolRespawn: !isDev
    },
    [
        'babel-loader'
        // '@babel/preset-env',
        // '@babel/preset-typescript',
        // '@babel/plugin-proposal-object-rest-spread',
        // '@babel/plugin-transform-spread',
        // '@babel/plugin-syntax-dynamic-import',
        // '@babel/plugin-proposal-decorators',
        // '@babel/plugin-proposal-class-properties'
    ]
);
{
                test: /\.(j|t)s$/,
                loaders: [
                    {
                        loader: 'thread-loader',
                        options: {
                            name: 'babel-pool',
                            poolRespawn: !isDev
                        }
                    },
                    {
                        loader: 'babel-loader',
                        options: {
                            compact: !isDev,
                            inputSourceMap: true,
                            sourceMap: true,
                            presets: [
                                '@babel/preset-env',
                                '@babel/preset-typescript'
                            ],
                            plugins: [
                                '@babel/plugin-proposal-object-rest-spread',
                                '@babel/plugin-transform-spread',
                                '@babel/plugin-syntax-dynamic-import',
                                [
                                    '@babel/plugin-proposal-decorators',
                                    {
                                        legacy: true
                                    }
                                ],
                                '@babel/plugin-proposal-class-properties'
                            ],
                            exclude: [/src[\\\/]assets[\\\/]js[\\\/].*/]
                        }
                    }
                ]
            },
@yocontra
Copy link

yocontra commented Mar 3, 2020

Duplicate of #75

@damianstone
Copy link

Anyone has the solution??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants