I was trying to inject Datatables library into my meteor app, but I found that meteor doesn't always include the file injected via the <script>
tag:
<script src="http://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js">
However, when I add the same file via an atmosphere package, it somehow does the job:
meteor add ksrv:datatables
Look at the source code for this package on github. It has just one file, which is exactly the same file I was trying to include earlier, but via <script>
tag, and somehow, that works.
What is the difference between injecting files via <script>
tags in the HTML file, and injecting files via atmosphere meteor packages?
In Meteor development there are no patterns for using a
<script>
tag in html. Javascript functionality is added via:meteor add packagename
npm install packagename
The meteor build system deals with adding all the above into your application. In a development environment you will see every script loaded individually into your HTML. In a production deployment all the javascript, both packages and your own code, is minified and concatenated into a single script that is loaded into your single page application.