Skip to content

Use file-loader and url-loader #8

Open
@jussikinnula

Description

@jussikinnula

Current WebPack uses copy plugin to copy src/images to target/assets/images. Instead of this we should use file-loader and url-loader to require the assets directly.

Please see details from my other project:
https://github.com/jussikinnula/react-starter/blob/typescript/config/webpack.common.ts#L72-L87

On Stylus -files, files are required by relative path like:
background-image url('./foo.jpg')

On Pug -files, files are required with a require() like:
img([src]="./require('./bar.jpg')")

On TypeScript -files require() is used as well, however, the current implementation of Angular.fi site doesn't have any logic to load images done on TypeScript files side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions