不会从导入的CSS文件加载CSS

时间:2019-10-04 11:40:23

标签: angularjs ecmascript-6 import sass

我使用AngularJSdashboard.scss导入到index.js中,该{@ 1}}会导入所有必需的依赖项,例如:

index.js

import angular from 'angular';

import 'dashboard.scss';

import DashboardService from './services/dashboard.service.js';
import CalculateService from '../../services/calculate.service.js';
import CostAnalysisService from '../../services/cost-analysis.service.js';

import DashboardController from './controllers/dashboard.controller';
import AvailableActionsController from './controllers/actions-available.controller';
import GraphDonutController from './controllers/donut-chart.controller';

import routing  from './dashboard.routes';

export default angular.module('ppApp.dashboard', [DashboardService, CalculateService, CostAnalysisService]) //import dashboard view controllers
    .config(routing)
    .controller('DashboardController', DashboardController)
    .controller('AvailableActionsController', AvailableActionsController)
    .controller('GraphDonutController', GraphDonutController)
    .name;

所有文件都与index.js位于同一目录中。当我加载应用程序时,除了dashboard.scss中的CSS之外,其他所有东西都没有加载。但是,当我更改语法并在控制台中记录了导入变量时:

import {} from 'dashboard.scss';
console.log({})

有效...

问题

为什么不dashboard.scss使用语法import 'dashboard.scss'导入?

0 个答案:

没有答案