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

rc-config-loader doesn't view config file in current path #3

Open
ravecat opened this issue Nov 29, 2018 · 1 comment
Open

rc-config-loader doesn't view config file in current path #3

ravecat opened this issue Nov 29, 2018 · 1 comment
Labels
Type: Question Further information is requested

Comments

@ravecat
Copy link

ravecat commented Nov 29, 2018

Accorind sources, if I haven't options rc-config-loader use default path for search - current directory

const configFileName = opts.configFileName || `.${pkgName}rc`;

So I use loader without options and get undefined. Code available here

  1. git clone https://github.com/ravecat/mendeleev.git --single-branch --branch rc-config-loader-issue
  2. yarn

aTry to use in src/common/Media/responsive/index.js

/* eslint-disable */
import { css } from "styled-components";

const rcfile = require("rc-config-loader");

const responsive = (property, resolution) => {
  console.log(rcfile('sct'))

  return css`
    @media (max-width: ${resolution}px) {
      ${property};
    }
  `;
}

export default responsive;

Probably it's webpack settings relative with resolve options, but I use relative path, not absolute

@ravecat
Copy link
Author

ravecat commented Dec 1, 2018

Updated branch.

And I get config in tests.

 PASS  src/common/Media/responsive/index.test.js
  ● Console

    console.log src/common/Media/responsive/index.js:7
      { config: { responsive: [ 1023, 1600 ] },
        filePath: '/home/max/project/mendeleev/.sctrc' }

but get undefined in web app, probably it depends from runtime environment

@azu azu added the Type: Question Further information is requested label Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants