Meteor build removes .md files - any way to fix?


#1

I am reading markdown files into the application. This works with meteor running the server but on production it fails because no markdown files are present after running meteor through meteor build. The reason for reading the markdown files is a way to load documentation into the app.

Is there a way for meteor build to keep markdown files?


#2

does it happen to you when you put those files into /private?


#3

Meteor builds your app and bundles only the html css and js when you build for production. The exceptions are your public and private directories which everything in them are bundled as assets.


#4

Oh that makes sense… that fundamentally breaks that strategy. I guess I have to write a dirty path hack now for source vs build directories on prod. :smile:


#5

how about using the Assets API ?


#6

All the documentation files are related to components so we have a directory structure like

component/buttons/{button.md, button.scss, button.html}

Assets API wouldn’t allow us to read in the above format.


#7

You could potentially make a build plugin to build the markdown files into assets. Wouldn’t be too hard, not sure if it is easier or harder than other options?

Build plugins: http://docs.meteor.com/#/full/Package-registerBuildPlugin
Adding an asset from a source handler: https://github.com/meteor/meteor/wiki/CompileStep-API-for-Build-Plugin-Source-Handlers#compilestepaddassetoptions


#8

hey @sashko, while we’re on the build plugin note, is there any way to use multiple plugins for the same file extension?

case in point, I would like to do some processing of my own on .less files in collusion with the less package


Processing '.less' files with multiple source handlers?