在react项scss文件中显示空代码空间

问题描述 投票:1回答:1

我是React的新手。我已经安装了jqwidgets和node-sass包。

我运行:npm install --save node-sass

在JS组件文件中:

import './style.scss';

在style.scss中:

.welcome{
  background-color: firebrick;
}

然后我在浏览器style.scss上打开开发人员工具,我看到:

module.exports = __webpack_public_path__ + "static/media/style.7388d000.scss";


//////////////////
// WEBPACK FOOTER
// ./src/components/Welcome/style.scss
// module id = ./src/components/Welcome/style.scss
// module chunks = 0

为什么sass样式代码没有显示?

packages.json:

{
  "_from": "https://github.com/jqwidgets/my-app2/tarball/master",
  "_id": "[email protected]",
  "_inBundle": false,
  "_integrity": "sha512-TzCrV6rvvYS5En18r6qrM2T7Rz24DQomJCLmQ2j/V08534YPijH5CjTAKJcDI8vNHM+HgyNS3YFxDVd0mHWSqg==",
  "_location": "/my-app2/my-app2",
  "_phantomChildren": {},
  "_requested": {
    "type": "remote",
    "raw": "my-app2@https://github.com/jqwidgets/my-app2/tarball/master",
    "name": "my-app2",
    "escapedName": "my-app2",
    "rawSpec": "https://github.com/jqwidgets/my-app2/tarball/master",
    "saveSpec": "https://github.com/jqwidgets/my-app2/tarball/master",
    "fetchSpec": "https://github.com/jqwidgets/my-app2/tarball/master"
  },
  "_requiredBy": [],
  "_resolved": "https://github.com/jqwidgets/my-app2/tarball/master",
  "_shasum": "7d2a1b35e0af075c74da15c045aaddabd7a70e35",
  "_spec": "my-app2@https://github.com/jqwidgets/my-app2/tarball/master",
  "_where": "C:\\Users\\Evoiu\\AppData\\Roaming\\npm\\node_modules\\my-app2",
  "bundleDependencies": false,
  "dependencies": {
    "axios": "^0.18.0",
    "react": "16.4.1",
    "react-dom": "16.4.1",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-router-redux": "^4.0.8",
    "react-scripts": "1.1.4"
  },
  "deprecated": false,
  "description": "Please refer to its documentation:   - [Getting Started](https://github.com/jqwidgets/my-app2/blob/master/README.md#getting-started)    - [jQWidgets React Documentation](http://www.jqwidgets.com/reactjs-components-documentation/)",
  "name": "my-app2",
  "private": true,
  "scripts": {
    "build": "react-scripts build",
    "eject": "react-scripts eject",
    "start": "react-scripts start",
    "test": "react-scripts test --env=jsdom"
  },
  "version": "1.0.0",
  "devDependencies": {
    "node-sass": "^4.11.0",
    "sass-loader": "^7.1.0"
  }
}

我花了这么多时间,不知道哪里有问题...... :(

如果我创建只有node-sass的新项目,那么它的工作。为什么它不使用jqwidgets的原因。

reactjs node-sass
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.