Skip to content

Instantly share code, notes, and snippets.

@daffl
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daffl/dd6bf4e7f5971774d3ea to your computer and use it in GitHub Desktop.
Save daffl/dd6bf4e7f5971774d3ea to your computer and use it in GitHub Desktop.
Using CanJS 2.2 with StealJS and NPM
import $ from 'jquery';
import stache from 'can/view/stache/stache';
const template = stache('Hello {{message}}!');
$(() => {
$('body').append(template({ message: 'David' }));
});
<!DOCTYPE html>
<html>
<head>
<title>CanJS + Steal + NPM demo</title>
</head>
<body>
<script type="text/javascript" src="node_modules/steal/steal.js"></script>
</body>
</html>
{
"name": "steal-can",
"version": "0.0.1",
"description": "A StealJS + CanJS example",
"main": "app",
"scripts": {
"build": "steal-tools"
},
"author": "Bitovi",
"license": "MIT",
"dependencies": {
"can": "^2.2.5",
"jquery": "^2.1.3",
"steal": "^0.9.3"
},
"devDependencies": {
"steal-tools": "^0.9.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment