我的React JS教程有问题

时间:2017-12-19 00:29:07

标签: node.js reactjs webpack sass gulp

我正在使用React JS Tutorial for Beginners - 使用React,Sass,Gulp和Node.js构建网站 我未能遵守以下消息

./src/App.js 
  Module not found: Can't resolve './Assets/css/default.min.css' in '/Users/qiangbarejie/Desktop/react/reactTutorial/my-react-project/src'

在构建期间发生此错误,无法解除。

我的App.js

import React, { Component } from 'react';
import './Assets/css/default.min.css';

class App extends Component {
  render() {
    return (
      <div className="App">
        <header>
           Test header
        </header>
      </div>
    );
  }
}
 export default App;

my gulpfile.js

'use strict';

// dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var changed = require('gulp-changed');

///////////////
// - SCSS/CSS
///////////////

var SCSS_SRC = './src/Assets/*.scss';
var SCSS_DEST = './src/Assets/css';

// Compile SCSS_SRC
gulp.task('compile_scss', function(){
  gulp.src(SCSS_SRC)
  .pipe(sass().on('error', sass.logError))
  .pipe(minifyCSS())
  .pipe(rename({ suffix: '.min '}))
  .pipe(changed(SCSS_DEST))
  .pipe(gulp.dest(SCSS_DEST));
});

// detect changes in SCSS
gulp.task('watch_scss', function(){
  gulp.watch(SCSS_SRC, ['compile_scss']);
});

// Run tasks
gulp.task('default', ['watch_scss']);

如果有人知道我应该如何解决这个问题,请帮助我,我将不胜感激,谢谢!

1 个答案:

答案 0 :(得分:0)

你有文件&#34; default.min.css&#34;在文件夹&#34; / Users / qiangbarejie / Desktop / react / reactTutorial / my-react-project / src / Assets / css /"?