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

Fix error when dynamic importing js files which imports raw files #190

Merged
merged 1 commit into from
Dec 11, 2017

Conversation

marcioj
Copy link
Contributor

@marcioj marcioj commented Dec 10, 2017

For example given the following files:

cat.js

import cat from './cat.jpg';

export default function renderCat() {
  // renders <img src={cat} > somehow
}

app.js

import('./cat.js').then(modules => modules.default())

Throws TypeError: bundleLoaders[type] is not a function because bundleLoaders has just css and js handlers.

Note this is different from dynamic importing the jpg file directly, which I believe is not supported in the moment. In this case we are lazy loading a js file but it depends on a raw asset.

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

Successfully merging this pull request may close these issues.

2 participants