Skip to content

Commit 08467ce

Browse files
committed
Merge pull request #1077 from DaftMonk/fix-sass-relative-paths
fix(gen:css): ensure scss/less/stylus files have proper relative paths
2 parents 8054bbb + 799e94b commit 08467ce

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

Diff for: app/templates/Gruntfile.js

+4-21
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,6 @@ module.exports = function (grunt) {
609609
stylus: {
610610
server: {
611611
options: {
612-
paths: [
613-
'<%%= yeoman.client %>/bower_components',
614-
'<%%= yeoman.client %>/app',
615-
'<%%= yeoman.client %>/components'
616-
],
617612
"include css": true
618613
},
619614
files: {
@@ -626,11 +621,6 @@ module.exports = function (grunt) {
626621
sass: {
627622
server: {
628623
options: {
629-
loadPath: [
630-
'<%%= yeoman.client %>/bower_components',
631-
'<%%= yeoman.client %>/app',
632-
'<%%= yeoman.client %>/components'
633-
],
634624
compass: false
635625
},
636626
files: {
@@ -641,18 +631,11 @@ module.exports = function (grunt) {
641631

642632
// Compiles Less to CSS
643633
less: {
644-
options: {
645-
paths: [
646-
'<%%= yeoman.client %>/bower_components',
647-
'<%%= yeoman.client %>/app',
648-
'<%%= yeoman.client %>/components'
649-
]
650-
},
651634
server: {
652635
files: {
653636
'.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.less'
654637
}
655-
},
638+
}
656639
},<% } %>
657640

658641
injector: {
@@ -686,7 +669,7 @@ module.exports = function (grunt) {
686669
options: {
687670
transform: function(filePath) {
688671
filePath = filePath.replace('/client/app/', '');
689-
filePath = filePath.replace('/client/components/', '');
672+
filePath = filePath.replace('/client/components/', '../components/');
690673
return '@import \'' + filePath + '\';';
691674
},
692675
starttag: '// injector',
@@ -705,7 +688,7 @@ module.exports = function (grunt) {
705688
options: {
706689
transform: function(filePath) {
707690
filePath = filePath.replace('/client/app/', '');
708-
filePath = filePath.replace('/client/components/', '');
691+
filePath = filePath.replace('/client/components/', '../components/');
709692
return '@import \'' + filePath + '\';';
710693
},
711694
starttag: '// injector',
@@ -724,7 +707,7 @@ module.exports = function (grunt) {
724707
options: {
725708
transform: function(filePath) {
726709
filePath = filePath.replace('/client/app/', '');
727-
filePath = filePath.replace('/client/components/', '');
710+
filePath = filePath.replace('/client/components/', '../components/');
728711
return '@import \'' + filePath + '\';';
729712
},
730713
starttag: '// injector',

Diff for: app/templates/client/app/app(less).less

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<% if (filters.bootstrap) { %>@import 'bootstrap/less/bootstrap.less';<% } %>
2-
@import 'font-awesome/less/font-awesome.less';
1+
<% if (filters.bootstrap) { %>@import '../bower_components/bootstrap/less/bootstrap.less';<% } %>
2+
@import '../bower_components/font-awesome/less/font-awesome.less';
33

4-
<% if (filters.bootstrap) { %>@icon-font-path: '/bower_components/bootstrap/fonts/';<% } %>
5-
@fa-font-path: '/bower_components/font-awesome/fonts';
4+
<% if (filters.bootstrap) { %>@icon-font-path: '../bower_components/bootstrap/fonts/';<% } %>
5+
@fa-font-path: '../bower_components/font-awesome/fonts';
66

77
/**
88
* App-wide Styles

Diff for: app/templates/client/app/app(sass).scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<% if (filters.bootstrap) { %>$icon-font-path: "/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";<% } %>
2-
$fa-font-path: "/bower_components/font-awesome/fonts";
1+
<% if (filters.bootstrap) { %>$icon-font-path: "../bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";<% } %>
2+
$fa-font-path: "../bower_components/font-awesome/fonts";
33
<% if (filters.bootstrap) { %>
4-
@import 'bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';<% } %>
5-
@import 'font-awesome/scss/font-awesome';
4+
@import '../bower_components/bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';<% } %>
5+
@import '../bower_components/font-awesome/scss/font-awesome';
66

77
/**
88
* App-wide Styles

Diff for: app/templates/client/app/app(stylus).styl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import "font-awesome/css/font-awesome.css"
2-
<% if (filters.bootstrap) { %>@import "bootstrap/dist/css/bootstrap.css"
1+
@import "../bower_components/font-awesome/css/font-awesome.css"
2+
<% if (filters.bootstrap) { %>@import "../bower_components/bootstrap/dist/css/bootstrap.css"
33

44
//
55
// Bootstrap Fonts

0 commit comments

Comments
 (0)