小编Deo*_*yma的帖子

错误:缓存未配置。当我将 Font Awesome 安装到我的 React 应用程序时 Babel 的插件

我想在我的 React 应用程序中使用 Font Awesome,但是当我安装Font Awesome的 npm 时,出现以下错误:

Error: Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
  for various types of caching, using the first param of their handler functions:
  module.exports = function(api) {
    // The API exposes the following:
    // Cache the returned value forever and don't call this function again.
    api.cache(true);
    // Don't cache at all. Not recommended because it will be very slow.
    api.cache(false);
    // Cached based on the value …
Run Code Online (Sandbox Code Playgroud)

javascript font-awesome reactjs babeljs

14
推荐指数
1
解决办法
9100
查看次数

SvelteKit - 如何使 SCSS 变量/混合对所有组件全局可用?

在 Nuxt 中,我使用Style Resources 包使 SCSS 全局可用,并且我可以访问任何组件中的变量和 mixin。如何在 SvelteKit 中做同样的事情?

javascript css svelte sveltekit

11
推荐指数
2
解决办法
1万
查看次数

测试库 React - 期望多个元素通过指定条件

我的组件中有多个按钮,所有这些按钮都应该被​​禁用。

const buttons = screen.getAllByRole('button');

expect(ALL BUTTONS).toHaveAttribute('disabled'); // I want something like this.
Run Code Online (Sandbox Code Playgroud)

我们怎样才能以最方便的方式写这个呢?

javascript reactjs jestjs react-testing-library testing-library

10
推荐指数
1
解决办法
7118
查看次数

将 scss 加载到 Vue3 时出错 TypeError: this.getOptions 不是函数

我尝试将 scss 样式文件加载到 Vue3 项目中。

我用:

"@vue/cli": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/compiler-sfc": "^3.0.11",
"sass": "^1.32.13",
"sass-loader": "^11.1.1",
"vue": "^3.0.11",
"vue-resource": "^1.3.4",
"webpack": "5.0.0"
Run Code Online (Sandbox Code Playgroud)

我仍然有销售问题:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
      at Object.loader (/home/dev/src/my-app/node_modules/sass-loader/dist/index.js:25:24)
Run Code Online (Sandbox Code Playgroud)

一切都是最新的,我已经删除了我的node_modules并重新安装了它们。我还删除了 node-sass 所以我只有 sass 包。

javascript sass sass-loader vuejs3 webpack-5

3
推荐指数
1
解决办法
9432
查看次数