hereandnow / grunt-jsmart Goto Github PK
View Code? Open in Web Editor NEWCompile Smarty Templates with jSmart: https://github.com/umakantp/jsmart
License: MIT License
Compile Smarty Templates with jSmart: https://github.com/umakantp/jsmart
License: MIT License
Your package.json file includes the fork my https://github.com/umakantp/jsmart
https://github.com/umakantp/jsmart has improved and fixed many bugs compared to the one you have used. You can reconsider using of https://github.com/umakantp/jsmart
What is this supposed to be for?
For me, it's appending a period to the bottom of my html, unless I do:
options: {
templatePath: 'src/templates/',
punctuation: ''
},
I already used grunt jsmart without problems but now i can't use it anymore. I get this error message:
"Warning: Cannot read property 'prototype' of undefined Use --force to continue."
Previously my setup was working, so i thought ok let's make a clear gruntfile only with the examples you provide on this github page and neither did this work. I get always this message:
"Warning: Cannot read property 'prototype' of undefined Use --force to continue."
This is what i use:
npm 6.1.0
node 10.1.0
Folders:
dest
src
-partials
-templates
--books.tpl
package.json
{
"name": "",
"description": "",
"private": true,
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"devDependencies": {
"grunt": "^1.0.3",
"grunt-jsmart": "^0.2.1"
}
}
gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsmart: {
options: {
templatePath: 'src/partials',
data: {
greeting: 'Hi, there are some JScript books you may find interesting:'
}
},
your_target: {
files: {
'dest/books.html': ['src/templates/books.tpl'],
}
}
},
});
grunt.loadNpmTasks('grunt-jsmart');
grunt.registerTask('your_target', ['jsmart']);
};
books.tpl
<title>Info</title>User Information: Name: {$name} Address: {$address}
Is it because of a new npm or node version?
Task-target is missing in at least three places in readme.md causing examples to run without producing any files, and without spitting out any errors.
files: {
'dest/books.html': ['src/templates/books.tpl'],
},
should be:
someTargetName: {
files: {
'dest/books.html': ['src/templates/books.tpl']
}
}
options: {
templatePath: 'src/templates/',
data: 'src/data/',
punctuation: '',
},
dist: {
files: {
'dist/index.html': ['src/templates/index.tpl'],
'dist/product.html': ['src/templates/product.tpl'],
'dist/category.html': ['src/templates/category.tpl'],
}
}
All files get created, but all but dist/index.html
are empty, no matter what they have in the src.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.