Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Fixing rfrModule loading issues #59

Closed
wants to merge 1 commit into from

Conversation

Cyclodex
Copy link
Contributor

@Cyclodex Cyclodex commented Nov 7, 2018

Issue

I forked your project and doing some changes.
I then use my package as dependency on an other client project.

The problem now is, that npm install somehow installs the rfr module in the client projects node_modules instead of within the stylemark package (node_modules/stylemark/node_modules) which would solve the problem.
I don't understand yet completely why this is happening, and why

"bundleDependencies": [
    "rfr"
  ],

doesn't work as expected...

This is of course problematic, because you then use the RFR module to build up the file paths and this is in the wrong location.

Solution

I could fix the path issues with setting the Root relative to its loaded file.

Within bin/stylemark:

var stylemarkRootPath = path.resolve(__dirname, '..');
rfr.setRoot(stylemarkRootPath);

Feature Sponsored by

If you like this change, feel free to review and accept this PR ;)
This feature/PR is sponsored by the company I work: Garaio AG

…ls the rfr module within the root node_modules and not as part of the stylemark package node_modules.

We can fix the path issues with setting the Root relative to its loaded file.
@mpetrovich
Copy link
Owner

Thanks for taking the time to look into this issue and for your patience!

I'm a big fan of this idea: It is better to fix a bug by removing rather than adding code. Due to the flat nature of the source files, rfr doesn't add much value, so we can eliminate this issue entirely by removing our use of rfr. That change has been made and will be available in the next release.

@mpetrovich mpetrovich closed this Dec 16, 2018
mpetrovich added a commit that referenced this pull request Dec 16, 2018
Due to the simple project file hierarchy, node-rfr doesn't add much value and also causes issues such as #59
@mpetrovich
Copy link
Owner

Fixed in v3.0.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants