Skip to content

Using Sass.js in the browser with Webpack #95

@aapoalas

Description

@aapoalas

Hello sirs!

You have a wonderful, informative and simple documentation on how to use Sass.js in the browser with a module loader. But I am trying to figure out usage when using Webpack as the module loader. Now this sets up the challenge that the worker files come out as [hash].worker.js as default, so letting Sass.js know the Worker path as a string is a challenge. (Of course this could actually be circumvented by simply changing the worker files to [name].worker.js but lets not get caught in the details...)

Can you think of a way to allow Webpack to handle the worker loading without explicitly defining the worker file names?

EDIT: The answer to my question is, essentially: "No."

The longer answer is to use CopyWebpackPlugin to handle the copying of the worker file (and the wasm file in 0.11.0-beta.1 branch) to the output folder and explicitly defining the worker file names to those copied files.

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