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

Use file-loader and url-loader #8

Open
jussikinnula opened this issue Apr 25, 2017 · 2 comments
Open

Use file-loader and url-loader #8

jussikinnula opened this issue Apr 25, 2017 · 2 comments

Comments

@jussikinnula
Copy link
Contributor

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.

@jussikinnula
Copy link
Contributor Author

jussikinnula commented Apr 25, 2017

Actually on app.component.ts we should require manually all versions of logos (and use relative reference to logos everywhere, pointing towards src/app/logo_xxxx.png), so that the logo versions can be kept visible if someone wants to use them in slides etc. The logos are logo.png, logo.svg, logo-inverse.png and logo-inverse.svg.

@jussikinnula
Copy link
Contributor Author

After the implementation is finished, also the remaining src/images can be removed, as well as WebPack copy plug-in.

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

1 participant