Comments (22)
Instances with a Java back end using Spring boot and Maven
After an entire day of looking for the reason for the corrupt files in my specific case, I finally found a solutions, and it wasn't file-loader.
If you are running a Java back end with Spring boot and Maven, try adding the following to your pom (adjust appropriately to your directories, sorry about the formatting, Git doesn't want to format this code block, lol)
<build> <resources> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> <includes> <include>static/css/**</include> <include>static/fonts/**</include> <include>static/img/**</include> <include>static/js/**</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>static/css/**</exclude> <exclude>static/fonts/**</exclude> <exclude>static/img/**</exclude> <exclude>static/js/**</exclude> </excludes> </resource> </resources> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <addResources>false</addResources> </configuration> </plugin> </plugins> </build>
I added multiple directories, for description purposes. The filtering could potentially corrupt binary files. The warning is located at the bottom of this page. https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
Hope this helps anyone who had the specific issue that I ran into!
from file-loader.
This solved my issue: http://www.vimalselvam.com/2015/12/19/webpack-loader-for-fonts/
from file-loader.
@evilebottnawi can you please reopen this.
I am getting the following:
Failed to decode downloaded font: http://localhost:1234/dist/7ae020399e7233de5b0197bdc40bb9ca.otf
app.html#/diagnostics:1 OTS parsing error: name: table overruns end of file
Using:
export default {
externals: [
...Object.keys(externals || {}),
...Object.keys(possibleExternals || {}).filter(filterDepWithoutEntryPoints),
],
module: {
rules: [
...,
{
test: /\.(?:ico|proto|png|gif|mp4|m4a|mp3|jpg|svg|ttf|otf|eot|woff|woff2)$/,
use: {
loader: 'file-loader',
options: {
name: '[hash].[ext]',
emitFile: true,
},
},
},
],
},
output: {
path: path.join(__dirname, 'app'),
// https://github.com/webpack/webpack/issues/1114
libraryTarget: 'commonjs2',
},
from file-loader.
i have the same exact issue using http://materializecss.com/
from file-loader.
Same issue here
var fileLoader = 'file-loader?name=[path][name].[ext]';
...
{ test: /\.jpe?g$|\.gif$|\.png$|\.ico|\.svg$|\.woff$|\.ttf$|\.eot$/, loader: fileLoader },
from file-loader.
Same with font-awesome:
{
test: /\.(jpe?g|png|gif|svg|woff|woff2|eot|ttf)(\?v=[0-9].[0-9].[0-9])?$/,
loader: 'file?name=[sha512:hash:base64:7].[ext]',
exclude: /node_modules\/(?!font-awesome)/
}
from file-loader.
Try setting the publicPath:
{
"output": {
"publicPath": "http://localhost:9000/"
}
}
This is only necessary for me in dev mode for webpack. The production bundle works fine without it.
from file-loader.
Same issue.
from file-loader.
Sorry!. My issue come from shama/webpack-stream#87
from file-loader.
I had the same problem and @dharding is right. I documented what I found on StackOverflow: http://stackoverflow.com/questions/34133808/webpack-ots-parsing-error-loading-fonts/34133809#34133809
Hope it helps.
from file-loader.
Also have this problem! :(
from file-loader.
Is anyone looking on this problem? I'm also facing this issue.
@dharding : Your solution not works.
from file-loader.
If anyone is using Webpack with Gulp, this might solve the issue shama/webpack-stream@6169c96
from file-loader.
Hello, I had write a fontmin-loader to get the font subset
from file-loader.
Hello, I had write a fontmin-loader to get the font subset https://github.com/Roy9102/FontMin-loader
from file-loader.
I have the same issue, anybody have a solution?
from file-loader.
I have this problem in sherenab.com .
Solution ?????
from file-loader.
Have the same
from file-loader.
It seems that the only thing that works for me is using the url-loader for all fonts.
I don't know what the drawbacks are:
{test: /\.(woff|ttf|eot|svg)(\?v=[a-z0-9]\.[a-z0-9]\.[a-z0-9])?$/, loader: 'url-loader?limit=100000'}
I got this from stack overflow:
http://stackoverflow.com/questions/34133808/webpack-ots-parsing-error-loading-fonts
from file-loader.
Drawbacks of using url-loader
for all fonts:
- all of the font types has to be downloaded - they're in CSS file, so browser can't just choose the proper one - it has to download all of them
- when browser downloads the desired file format, it's done asynchronously. When you force browser to download it in css, you lose that
- base64 creates size overhead for data
from file-loader.
same problem
from file-loader.
Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!
from file-loader.
Related Issues (20)
- More documentation around esModules and their behavior please HOT 5
- In the webpack watch mode, the missing image output will appear HOT 1
- Jpeg-2000 support HOT 2
- Provide file stats via named exports HOT 1
- import png from './image.png'; png is object,is not a url(string) HOT 1
- copying images with picture tag HOT 2
- RFC: uglify option HOT 4
- Problem with import webp image HOT 1
- Pass additional assetInfo object when calling emitFile HOT 2
- Is the CDN example correct? HOT 2
- postTransformPublicPath does not work with runtime variables/methods HOT 2
- Breaking change desc in 5.0.0 can be improved HOT 1
- Breaking change desc in 5.0.0 can be improved HOT 5
- Support for loader chaning HOT 1
- 6.2.0 breaks file-loader for me HOT 3
- [Feature Request]Make `emitFile` tree shakingable HOT 6
- asset/resource hash in name HOT 12
- Random uppercase directory being generated HOT 1
- OTS parsing error: invalid version tag | Failed to decode downloaded font: http://localhost:3000/static/7542ab376339625d813fe71d074ee925.woff HOT 3
- OTS parsing error: invalid version tag | Failed to decode downloaded font: http://localhost:3000/static/7542ab376339625d813fe71d074ee925.woff HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from file-loader.