- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我之前将 Gulp 设置为使用 Sass、Pug 和 Babel。字体加载正常。我切换到使用 Parcel现在它按预期工作,除了一件事。字体未加载。
这是 _fonts.sass
的全部内容:
@font-face
font-family: "MyWebFont"
src: url(../fonts/economica-regular-otf.eot)
src: url(../fonts/economica-regular-otf.eot?#iefix) format("embedded-opentype"),
url(../fonts/economica-regular-otf.woff2) format("woff2"),
url(../fonts/economica-regular-otf.woff) format("woff"),
url(../fonts/economica-regular-otf.ttf) format("ttf")
@font-face
font-family: "MyWebFontBold"
src: url(../fonts/economica-bold-otf.eot)
src: url(../fonts/economica-bold-otf.eot?#iefix) format("embedded-opentype"),
url(../fonts/economica-bold-otf.woff2) format("woff2"),
url(../fonts/economica-bold-otf.woff) format("woff"),
url(../fonts/economica-bold-otf.ttf) format("ttf")
body
font-family: 'MyWebFont', 'Titillium Web', sans-serif
text-rendering: auto
text-rendering: geometricPrecision
文件夹结构如下:
/dist
/src
-- / pug
--- index.pug
-- / sass
--- _fonts.sass
--- _animations.sass
--- _blocks.sass
--- _elements.sass
--- styles.sass
-- / js
--- // all the scripts
-- / fonts
--- // all the fonts are here
您可以在此处("new"分支)找到元素文件:GitHub
最佳答案
我不久前解决了这个问题。
在 package.json
中,我将 build
脚本编辑为 "build": "parcel build src/pug/index.pug --public-url ./-d 距离”
。
然后我编辑了 _fonts.sass
所以 @font-face
不会进入目录。例如,src: url(../fonts/economica-regular-otf.eot)
变成了 src: url(./fonts/economica-regular-otf.eot)
.
我已经有一段时间没弄明白了,所以我不记得这背后的原因,但它确实有效。
关于html - @font-face 在安装 ParcelJS 后不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49304800/
当构建时不知道图像名称时,是否可以使用 parceljs 捆绑器动态加载图像 有没有类似于 webpack 的 require.context包裹内 代码片段(使用 React 和 Parcel) 这
我正在学习 parcel js。在文档中,描述了实时重新加载。 https://parceljs.org/getting_started.html 我怀疑当我更改 HTML 文件的内容时,我会看到我的
我在我的宠物项目中使用基本配置的 ParcelJS(最新的 - 1.4.1 版本): Title
我正在测试parceljs,并且可以很好地进行开发。我有一个普通的 css 来改变背景颜色,还有一个非常简单的 js 文件只是为了看看它是否工作。 CSS body { background-colo
我正在从 Webpack 迁移到 Parcel,并在我的组件中使用这样的文件夹别名: import * as authActions from 'actions/authActions'; 我收到此错
我正在尝试使用模块捆绑器 ParcelJS 构建一个模块。我希望这个特定模块对导入友好: 它应该是导入友好的 (ES6) 它应该是友好的(节点) 它应该是 script-src 友好的(浏览器) 它应
我有一个具有这种结构的项目: src |- index.pug | - layout | |- index.less | - scripts | |- index.js 现在
我想创建一个插件,以便我可以使用 parcel 原始加载某种类型的文件。包裹文档指出: Publish this package on npm using parcel-plugin- or @you
我正在将我的应用程序与parceljs捆绑在一起,并遇到了这个我目前无法解决的特定问题。 我有 1 个组件引用类似的图像 import defaultImage from '/path/to/imag
我试图在使用 Parcel.js 构建时公开一个变量,类似于 Webpack DefinePlugin但我还没有找到如何去做。 在开发中,我希望我的 API 主机与我的生产主机不同,因此: //dev
在 Webpack 中,有一种方法可以将输入文件中的所有 export 部分配置为全局对象,就像您对 lib(例如 moment.js 或 jQuery)的期望) 但是看起来新的构建工具 parcel
我有一个正在用包裹构建的项目。由于它大部分是静态的,我只有一些应该每天更新一次的文件,我将项目放在 aws s3 存储桶中。我正在考虑使用 lambda 函数更新应该每天更新一次的文件。但是,在我的项
在 Webpack 中,可以通过 proxy 代理后端请求。在配置文件中设置。这允许我使用带有 HMR 的 webpack-dev-server 开发我的应用程序的前端部分,而 webpack-dev
我在我的 Parcel 项目中使用带有绝对路径的导入,但这些绝对路径并没有被 Cypress 测试同等解析。 模块分辨率的差异 包裹 :import {foo} from '/foo.js' : 相对
我正在使用带有 express 的 Parcel 中间件,如下所述:https://parceljs.org/api.html#middleware 当我在生产中运行它时,我不希望打开热模块更换。 我
构建我的应用程序时,所有 HTML 注释都会被删除。 我尝试搜索文档,但找不到任何地方说明注释在构建时被删除。 例如,此评论将被删除: 一些背景 我正在尝试在服务器端渲染一个 ReactJS 应用
我需要在端口 1234 上运行我的 ReactJS 应用程序但是当我运行 yarn dev ,我得到以下信息: $ parcel src/index.html --port 1234 Server r
我之前将 Gulp 设置为使用 Sass、Pug 和 Babel。字体加载正常。我切换到使用 Parcel现在它按预期工作,除了一件事。字体未加载。 这是 _fonts.sass 的全部内容: @fo
将使用 ParcelJS 构建的 React 应用程序迁移到 Typescript/React,我遇到了一些环境变量问题。实际上,该问题似乎只影响错误输出,因为环境变量(URL,用于 标记)在网页上
通过parcel .htm 文件构建时,输出为.html 文件。 我更愿意将 .htm 文件保留为输出文件,但无法在 Parcel 或 Parcel 使用的 PostHTML 中找到一种方法。 我更新
我是一名优秀的程序员,十分优秀!