assets added through css/sass won't load in production
See original GitHub issueI have the following code in my css:
.pic{
background-image: url('@/assets/img/test.png');
width: 200px;
height: 200px;
}
it works fine while running the app in development mode, but in production the image was missing. Same happens with fonts:
@font-face {
font-family: 'Input Mono Narrow';
src: url('@/assets/fonts/InputMonoNarrowBold.woff2') format('woff2'), url('@/assets/fonts/InputMonoNarrowBold.woff') format('woff');
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Input Mono';
src: url('@/assets/fonts/InputMonoNarrowRegular.woff2') format('woff2'), url('@/assets/fonts/InputMonoNarrowRegular.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
Ideas?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Rails assets not compiling when pushing to production
Rails.application.config.assets.precompile += %w( *.css.sass ) ... I had a similar issue and had to use 2.11.0 to get it to work correctly.
Read more >Webpack 5 CSS Walkthrough: Sass, PostCSS and more!
This includes basic CSS, SASS, PostCSS with fallbacks and autoprefixer plugins, Injected inline styles vs css files for output, and a quick ...
Read more >React (Babel) and Sass webpack Tutorial: Extract CSS Into Its ...
Let's learn how to setup Babel, React, JSX, CSS, Sass and more with webpack!0:00 Intro1:27 Getting Started6:19 Loaders in webpack15:26 ...
Read more >css.md - Webpacker Docs
Webpacker supports importing CSS, Sass and SCSS files directly into your JavaScript files. Importing and loading styles is a two step process:.
Read more >Getting JavaScript to Talk to CSS and Sass
We can set the value of a custom property using setProperty : ... that it will work in local development mode but then...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try change
protocol.registerSchemesAsPrivileged([ { scheme: 'app', privileges: { secure: true, standard: true } } ])
toprotocol.registerSchemesAsPrivileged([ { scheme: 'app', privileges: { secure: true} } ])
in your background.jsSeems that this issue is solved by the solution provided by @wuql576