Giter VIP home page Giter VIP logo

grunt-jsmart's People

Stargazers

 avatar

Watchers

 avatar  avatar

grunt-jsmart's Issues

Cannot read property 'prototype' of ...

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 missing in readme.md examples

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']
            }
        }

Related stackoverflow question

Not working with multiple files

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.