2017-12-12 6 views
0

sass-loader, css-loader 및 style-loader를 설치합니다. 여기 내 웹팩 설정 :RessJS에서 다른 scss 파일로 scss 파일을 가져 오지 못함

var HTMLWebpackPlugin = require('html-webpack-plugin'); 
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({ 
    template: __dirname + '/app/index.html', 
    filename: 'index.html', 
    inject: 'body' 
}); 
module.exports = { 
    entry: __dirname + '/app/index.js', 
    module: { 
     loaders: [ 
      { 
       test: /\.js$/, 
       exclude: /node_modules/, 
       loader: 'babel-loader' 
      }, 
      { 
       test: /\.scss$/, 
       loaders: ['style-loader', 'css-loader'] 
      } 
     ] 
    }, 
    output: { 
     filename: 'index.js', 
     path: __dirname + '/build' 
    }, 
    plugins : [HTMLWebpackPluginConfig] 
}; 

동일한 폴더 내에 2 개의 scss 파일이 있습니다 : main.scss 및 variable.scss. 변수 .scss를 main.scss로 가져오고 싶지만 오류 메시지와 함께 실패했습니다 : "모듈을 찾을 수 없습니다 : 오류 : '변수'를 해결할 수 없습니다 '. 여기 내 main.scss입니다 :

@import "variables"; 

body { 
    color: black; 
} 

답변