Skip to content

Question for the authors #263

Closed
Closed
@ScriptedAlchemy

Description

@ScriptedAlchemy

Hey guys, I wanted to ask about the reasoning behind using a path for NS variable, instead of something static, like a string.

Heres the issue, lets say i have a build toolchain. The toolchain contains an import to mini-css, then elsewhere in the project core i also import mini-css.

What happens is i get an error saying this[NS] cant be resolved. When logging i discover that each instance has a new name which is used for loader context.

So the loader is looking for this[‘plugin-sass/node_modules/extract’], but the plugin is providing this[‘react-static/node_modules/extract']

I can change this by hard coding a string, and everything works perfectly across the instances.

const NS = '_extractCssChunks'; // works perfectly

Id like to know if there is any particular reason it was coded in this manner?
if i were to change the NS to something static in my project, would there any ramifications?

const NS = path.dirname(fs.realpathSync(__filename));

Appreciate your work and time.

@sokra

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