Skip to content

Conversation

@mitar
Copy link
Member

@mitar mitar commented May 6, 2018

Fixes #312.

@mitar
Copy link
Member Author

mitar commented May 6, 2018

See meteor/meteor#9865 for more details.

@akanix42
Copy link
Contributor

akanix42 commented May 7, 2018

Have you tried using inputFile.require? benjamn has specifically stated not to use app-module-path: meteor/meteor#7451 (comment).
inputFile.require is what I'm using in #314.

@mitar
Copy link
Member Author

mitar commented May 8, 2018

Have you tried using inputFile.require?

It is not possible to use that because require is called from other non-Meteor packages like postcss-load-config. So sadly this approach is not possible. See discussion here: Meteor-Community-Packages/meteor-postcss#15

@akanix42
Copy link
Contributor

akanix42 commented May 8, 2018

Ah, so the issue occurs when a Meteor package bundles an npm package and that npm package calls require to load a locally installed package?
It may not be ideal, but what if you used akryum:npm-check to locally install that package? For example, have it automatically locally install postcss-load-config, which you can then load with inputFile.require?

@mitar
Copy link
Member Author

mitar commented May 8, 2018

For example, have it automatically locally install postcss-load-config, which you can then load with inputFile.require?

Yea, you can load postcss-load-config with inputFile.require, but postcss-load-config calls require in turn which then does not find anything you installed in app's node_modules.

@mitar
Copy link
Member Author

mitar commented May 8, 2018

BTW, I think it would be better to discuss workarounds and solutions in meteor/meteor#9865. So whichever standard approach or fix we come up with for this issue we can then use to fix the issue here and in PostCSS and elsewhere. My current best approach I have found is using app-module-path. I do not like it, but I could not get anything else to work.

@Akryum Akryum merged commit cb2f0f2 into meteor-vue:master May 13, 2018
@Akryum
Copy link
Collaborator

Akryum commented May 13, 2018

Thanks! 👍

@eybarta
Copy link

eybarta commented Jun 21, 2018

Hey guys thanks for all your work...!

I'm trying to use lost grid (PostCSS) plugin inside .vue file,
is there any code example of how to make this work?

I have the following relevant packages:
akryum:vue-component
juliancwirko:postcss

Also using .postcssrc.js file as @mitar suggests, I'm getting no errors
but my styles are not getting compiled through postcss, it just renders as is..

please, any suggestions? haven't been able to find an example anywhere..

thx again.. and hope to see ya in a VueConf soooon! :)

@mitar
Copy link
Member Author

mitar commented Jun 28, 2018

You can check how I am doing it here: https://github.com/peer/doc

@eybarta
Copy link

eybarta commented Jul 1, 2018

@mitar thanks for the link.. I cloned it and tried to make the same PostCSS
lib (LostGrid) work with your code and didn't work as well:
screenshot 2018-07-01 11 01 08

All I did was add this to .postcssrc.js file:

// In our case, this is done when processing <style> tags inside Vue components.
  else {
    const config = {
      plugins: {
        // To import CSS files from NPM packages.
        'lost': {}
      },
    };
    return config;
  }

Am I missing something?

thx again for your time and help on this..

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

Successfully merging this pull request may close these issues.

4 participants