Possible to import files in the snippets.cson?


#1

I hate that all my code is in my snippets file directly, it makes my snippet file very long.

Is there any way to import files here and use the snippets.cson as a entry point?
e.g something like Sass @import or Browserify requires.
This way I could import a partial for html files, for scss and for js.

Thanks in advance


#2

Not currently, but that’s a great idea to suggest on the snippets package :grinning:

Although, packages can add snippets. So you could create your own local “html-snippets” package, “scss-snippets” package, and etc.


#3

Yeah I thought of that already but that’s difficult to configure in the long end.

I will open an issue on the github page of snippets.
Thanks

EDIT: Just tried a require because basically Atom is Node, but it didn’t work.


#4

There was a recent change to the snippets package (and possibly others) to stop evaluating CSON files as actual CoffeeScript code and only parse them as data. So I’m not surprised the require didn’t work.