Skip to content

Option 'includeAbsolutePaths' can't work well with inline loader #119

@licg9999

Description

@licg9999

Hi, there. I found an interesting case that can be consistently reproduced. If I specify option 'includeAbsolutePaths' and use an inline loader which contains a sub path '/node_modules/', webpack-node-externals would mistakenly externalize the target file that should be imported. For example:

// webpack.config.js
...
  externals: [nodeExternals({ includeAbsolutePaths: true })],
...
// entry file
import { greeting } from '!../node_modules/babel-loader/lib/index.js!./constants';

In this case, the file constants should be imported but in fact it's externalized. I created a repo licg9999/b6881284 so that you can reproduce the abnormally. Would you help fix it? Or do you mind my fixing it? Thanks.

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