Parcel: SCSS resouce file possible?

Created on 20 Mar 2018  路  5Comments  路  Source: parcel-bundler/parcel

I'm trying to migrate from webpack to parcel but in webpack i had my scss builder to add a resource.scss file to the head of every scss file in my project for variables/mixin's ect.

is that possible with parcel and im just missing it?

{
            loader: 'sass-loader',
            options: {
              data: '@import "styles/resources";',
              includePaths: [path.join(cwd, 'app')],
            },
          },
Question

Most helpful comment

I'm using a .sassrc.js at the moment which works for includePaths but not for data:

const path = require('path');
const cwd = process.cwd();

module.exports = {
    data: '@import "globals";',
    includePaths: [
        path.resolve(cwd, 'node_modules/susy/sass'),
        path.resolve(cwd, 'node_modules/normalize.scss'),
        path.resolve(cwd, 'node_modules'),
        path.resolve(cwd, 'static', 'scss')
    ]
};

All 5 comments

Same question here. That keeps me from migrating at the moment.

I'm using a .sassrc.js at the moment which works for includePaths but not for data:

const path = require('path');
const cwd = process.cwd();

module.exports = {
    data: '@import "globals";',
    includePaths: [
        path.resolve(cwd, 'node_modules/susy/sass'),
        path.resolve(cwd, 'node_modules/normalize.scss'),
        path.resolve(cwd, 'node_modules'),
        path.resolve(cwd, 'static', 'scss')
    ]
};

Fixed by #1035.

@steffenmllr how are you including that js file? just in your index?

@th3fallen I include per component. All my variables are in a globals.scss. Global styles (usually only a few) are included in the index.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzimmek picture jzimmek  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments

oliger picture oliger  路  3Comments

davidnagli picture davidnagli  路  3Comments

jsftw86 picture jsftw86  路  3Comments