bitjson / typescript-starter

Quickly create and configure a new library or Node.js project
https://bitjson.github.io/typescript-starter/
MIT License
3.48k stars 245 forks source link

Possible to have .scss with @imports and bundle the lib in Webpack DLL from the app? #139

Closed BruceL33t closed 5 years ago

BruceL33t commented 5 years ago

I'm facing a problem building my packages like this, if and only if I need to package (main or module) to be added to a webpack DLL. First of all I'm using copyfiles to copy all my non ts/tsx files to dist/build folder and I'm only bundling/transpiling from the App with webpack. The problem is that any @import inside my scss will not work if I add the package to the DLL plugin. Is this a limitation to this approach of building packages, do we need to bundle with rollup before shipping or can this be solved somehow?

ERROR in ./node_modules/my-library/dist/module/components/Parent/Child/Child.scss 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
> @import "../../../scss/mixins";