Skip to content
This repository was archived by the owner on May 29, 2022. It is now read-only.

concatenate before transpiling when allChunks === true. #5

@istrau2

Description

@istrau2

I just finished porting over from a regular webpack.config. I tried using config-sass like so:

require('@easy-webpack/config-sass')({ filename: 'styles-sass.css', allChunks: true, sourceMap: false })

and ran into issue where variables are not available. This is a result of having a dedicated variables file that I import in my main scss file like so:

@import('variables');
@import('some-other-file-that-uses-variables);

In the case above, if the scss files are all concatenated together prior to scss -> css transpilation, the variables will be available. Eventually I solved the problem by just using:

{ test: /\.scss$/, loader: 'raw' }

and then just importing the main.scss file like so:

import '!style!css!sass!./main.scss';

I believe this solves it because the main file imports all the others which are imported using the raw-loader. Then, the main file is transpiled and all variables are available at all references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions