在React项目的Scss文件中显示空代码空间

时间:2019-02-16 13:01:51

标签: reactjs node-sass

我是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": "my-app2@1.0.0",
  "_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一起使用。

1 个答案:

答案 0 :(得分:0)

https://www.jqwidgets.com/reactjs-components-documentation/documentation/create-jqwidgets-react-app/index.htm

您是否为此安装了jqwidgets-react-app?

我自己还没有测试过。