Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCSS imports doesn't work for third party library #248

Closed
elmariofredo opened this issue Oct 18, 2017 · 3 comments
Closed

SCSS imports doesn't work for third party library #248

elmariofredo opened this issue Oct 18, 2017 · 3 comments
Milestone

Comments

@elmariofredo
Copy link
Contributor

elmariofredo commented Oct 18, 2017

Resources:
Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

@stencil/starter@0.0.1 /root/bluma-elements
└── @stencil/core@0.0.6-13

I'm submitting a ... (check one with "x")
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

look at example repo here elmariofredo/bulma-elements#1 where I'm trying to stencilize material design button. In example I'm importing scss from material design package which is trying to import another scss file from other md package. This will end up with following error

[ ERROR ]  File to import not found or unreadable: @material/theme/_mixins. Parent style sheet:
           /root/bluma-elements/node_modules/@material/button/mdc-button.scss

this issue is well documented under material-components-web project
material-components/material-components-web#351 with resolution to add node_modules to includePaths in scss compiler settings.

Expected behavior:

Can we allow set scss config from stencil config?

Steps to reproduce:

checkout elmariofredo/bulma-elements#1 branch and run npm install && npm start

Related code:

const sassConfig = {
file: scssFilePath
};

Other information:

@adamdbradley adamdbradley added this to the 0.0.7 Release milestone Oct 19, 2017
@sghoweri
Copy link

^ this sort of thing has actually been the biggest reservation I've had with StencilJS (and why the design system I lead up is sticking around with SkateJS... for now).

If the "magic" of Stencil was exposed via a default WebPack config which others could extend or configure to their heart's content this sort of problem (or the dozens of others like including a custom Sass function / plugin that lets us output Sass Maps as JSON data or that we use an off the shelf Sass importer for automatically resolving npm namespaces) wouldn't be much of an issue...

Absolutely love love love the ideas I'm seeing being put into this. Just wish incorporating all this hard work into an existing Gulp / Webpack / Frontend workflow (vs replacing or side stepping) was more approachable. 😞

@elmariofredo
Copy link
Contributor Author

@sghoweri my experience with SkateJS is quite opposite as when building component library, tooling part could get really complicated and actually could negatively affect development. Therefore I'm happy with StencilJS approach where you can focus on components only as long as they will allow to tweak necessary configs as in this SCSS case. IMHO Webpack is not good fit for library bundling it is possible but feels awkward.

elmariofredo added a commit to elmariofredo/stencil that referenced this issue Oct 21, 2017
to allow sass compile fine tunning

Closes ionic-team#248
elmariofredo added a commit to elmariofredo/stencil that referenced this issue Oct 21, 2017
to allow sass compile fine tunning

Closes ionic-team#248
@elmariofredo
Copy link
Contributor Author

For others who can't wait to tweak scss config in stencil here is naive fix elmariofredo@116a965 also for this particular case one can use very unexpected hotfix

$ SASS_PATH=node_modules npm start

1 8

adamdbradley pushed a commit that referenced this issue Oct 24, 2017
to allow sass compile fine tunning

Closes #248
@adamdbradley adamdbradley modified the milestones: 0.0.7 Release, 0.0.6 Release Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants