Partial .scss files are compiled although they were not included in main .scss file
See original GitHub issueHi!
I am starting a new brunch project after so long time.
By the moment I have the following scss structure:
styles/ ├──features/ ├──├──directives/ ├──├──├──loading/ ├──├──├──├──_loading.scss ├──lib/ ├──├──_global.scss ├──├──_globalLasts.scss ├──├──_variables.scss ├──views/ ├──├──_gallery.scss ├──├──_home.scss ├──styles.scss
The styles.scss content is:
// Libraries
@import "lib/variables";
@import "lib/global";
// Components
@import "features/directives/loading/loading";
// Layouts
// Views
@import "views/gallery";
@import "views/home";
@import "lib/globalLasts";
My brunch-config.js file is the fllowing one:
exports.config = {
npm: {
enabled: false
},
fileListInterval: 2000,
files: {
javascripts: {
joinTo: {
'js/app.js': /^app(\/|\\)angular/,
'js/vendor.js': /^(app(\/|\\)vendor|bower_components)/
},
order: {
before: [
'bower_components/angular/angular.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
],
after: [
'app/angular/router/router.js',
'app/angular/app.js'
]
}
},
stylesheets: {
order: {
before: []
},
joinTo: {
'css/app.css': /^app(\/|\\)angular(\/|\\)styles/,
'css/vendor.css': /^(app(\/|\\)vendor|bower_components)/
}
},
templates: {
joinTo: {
'js/templates.js': /^app(\/|\\)angular(\/|\\)views/
}
}
},
modules: {
wrapper: false,
definition: false
},
plugins: {
jshint: {
pattern: /^app(\/|\\)angular(\/|\\).*\.js$/,
options: {
strict: true,
bitwise: true,
curly: true,
unused: true,
eqeqeq: true
},
warnOnly: true
},
digest: {
alwaysRun: false,
environments: ['production']
},
afterBrunch: [
'rm -f public/config/config_*.json',
'cp bower_components/components-font-awesome/fonts/* public/fonts',
'cp bower_components/bootstrap/fonts/* public/fonts'
],
uglify: {
mangle: false
},
browserSync: {
watch: true,
port: 3333,
logLevel: "debug"
}
},
// Configuracion especifica del servidor NodeJS utilizado mediante Brunch
server: {
path: 'app.js',
port: 3333,
base: '/'
}
};
I remember that the correct way is define a main file (style.scss) and other like partials (starting with underscore: _).
However, I am getting an error when compiling my brunch project, because I am using a $color variable in _loading.scss file that is declared in lib/_variables.scss file.
I tried to comment all @imports from my styles.scss file and I saw that the partials file are compiled always, although I don’t add them yo my main file.
I reviewed the docs and I can see that the partial files are ignored if they starts with underscore.
The version of sass-brunch I am using is 2.10.7.
Am I doing something wrong? Or there is now another way for ignore the partials file?
Thank you so much.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (6 by maintainers)
Top GitHub Comments
Hello @paulmillr, I think having found the issue. Here my PR https://github.com/brunch/sass-brunch/pull/181
There is just one thing that I don’t fully understand, the
@import '../../app/styles/globbed/*
seem to not work with my changes… And IDK why…[EDIT] Oh yeah ! I succeed 😄
The new release fix this Issue @jualoppaz https://www.npmjs.com/package/sass-brunch/v/2.10.8