Skip to content

Not importing directories #4

Description

@rmsheppard

Trying to import all files in a directory but it is causing my app to crash:

import LogViews from './Logs'

When looking at the error in my webpack console I see the follow exceptions:

] looking for modules in C:\myProject\node_modules
[WEBPACK] using description file: C:\myProject\package.json (relative path: ./node_modules)
[WEBPACK] Field 'browser' doesn't contain a valid alias configuration
[WEBPACK] after using description file: C:\myProject\package.json (relative path: ./node_modules)
[WEBPACK] using description file: C:\myProject\package.json (relative path: ./node_modules/Logs/ChangeHistoryLog)
[WEBPACK] no extension
[WEBPACK] Field 'browser' doesn't contain a valid alias configuration
[WEBPACK] C:\myProject\node_modules\Logs\ChangeHistoryLog doesn't exist
[WEBPACK] .json
[WEBPACK] Field 'browser' doesn't contain a valid alias configuration
[WEBPACK] C:\myProject\node_modules\Logs\ChangeHistoryLog.json doesn't exist
[WEBPACK] .js
[WEBPACK] Field 'browser' doesn't contain a valid alias configuration
[WEBPACK] C:\myProject\node_modules\Logs\ChangeHistoryLog.js doesn't exist
[WEBPACK] as directory
[WEBPACK] C:\myProject\node_modules\Logs\ChangeHistoryLog doesn't exist

So, it looks like it is referencing the correct file names but can't actually find the code, and I'm guessing it falls back to checking the node modules folder. Any ideas! Could be something I'm doing wrong maybe not sure. I have it specified in the .babelrc file

{ "presets": ["react", "es2015", "stage-0"], "plugins": ["import-directory"] }

Is there a specific way to load this when using webpack?

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