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

webpack loaders right way #7

Open
spac3unit opened this issue Jan 6, 2018 · 1 comment
Open

webpack loaders right way #7

spac3unit opened this issue Jan 6, 2018 · 1 comment

Comments

@spac3unit
Copy link

spac3unit commented Jan 6, 2018

Hello. Can you provide some info about using loaders in webpack configs?
I trying to load png and jpg files in my component:
import image from "../../assets/cover.png"
and have error:
Unexpected character '�' (1:0)

i tried with url-loader and file-loader in my webpack/developement.js and webpack/production.js, like this:

{
        test: /\.(png|jpg|gif)$/,
        use: [
          {
            loader: "file-loader",
            options: {}
          }
        ]
}

Thx!

@earnubs
Copy link
Owner

earnubs commented Jan 6, 2018

That'll need Webpack operating on the server side code too (or a Babel plugin), to deal with any requires for things that aren't JavaScript (like images and CSS). At the minute it's set up for the simple case where we're just dealing with JavaScript, but maybe not that's not so realistic, so we'll get this done.

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

2 participants