This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Joshua Crowley
Posted Apr 23 - Read on Facebook

I've been trying a workflow that others have mentioned, when I break components out into modules, as I design them. The modules (12 of them) are reused across 4 separate prototype files. It's been great, but I'm hoping to consolidate them into one directory, from which all prototypes require. I started to move them into my NPM directory, but I don't think I understand the syntax/concept. I think others have a similar workflow, any suggestions?


Dave Crow

I have no idea how to make this work, but I'd love to see a tutorial to learn how.

Kevyn Arnott

You can just use dot syntax. For example, if you have a field, text, and buttons, you'd set the name in the module as exports.field, exports.text, and exports.button. Then the file, you can important that module, for example, as mod. Then you can access the different components as mod.field, mod.text, and mod.button.

Mike Hughes

Ditto, working on bringing in a Node.js sample project/SDK and having real problems getting it to work as a module I can actually use in Framer. Works fine as a Node.js app, but no matter what I try can't get it working as a module.

Marc Krenn

Koen that's the point I was trying to make yesterday :)

re: Code folding / Modules duality, or lack thereof

Read the entire post on Facebook