Skip to content

webpack-dev-server 2.8.1 triggers a bug in webpack-split-by-path #33

@hpatelx

Description

@hpatelx

Running into this issue.

6% basic chunk optimization/home/project/node_modules/webpack-split-by-path/index.js:167
if (ignore[i].test(resourcePath)) {
^

TypeError: ignore[i].test is not a function

Webpack configuration:

const SplitByPathPlugin = require('webpack-split-by-path');

new SplitByPathPlugin([ {name: 'vendor', path: path.join(__dirname, 'node_modules')}, ], {ignore: [/style-loader/, /css-loader/, /less-loader/, /\.scss$/, /\.css$/]} ),

This issue is we have a polyfilled includes method on array. This breaks webpack
bundle generation since polyfill method is iterated in for loop.

for (var i in ignore) { if (ignore[i].test(resourcePath)) { return match; } }

This is caused by webpack-dev-server > 2.7.1.
Suggestion would be update for loop to iterate on own properties. I can submit pull req after some discussion to ensure I'm not the only one with this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions