1.7.9 • Published 9 years ago

grunt-chest-compiler v1.7.9

Weekly downloads
138
License
MIT
Repository
github
Last release
9 years ago

grunt-chest-compiler

dynamic and static javascript modules in the browser with a footprint only as large as it needs to be.

What is it, precious? How does it work?

It allows for dynamic module based development, it concats js files making sure dependencies are accessible, it assumes that main.js will be injected to the html. If main includes other modules - require(module_name) - put the modules in main.js, before they are needed. In a sense it's like browserify, but it also allows for dynamic inclusions: require(module_name, callback). If any static dependency - require(module_name) - is shared between any two modules that do not have parents (modules that statically depend on them), that dependency is moved to main.js. But you don't need to care about all that, you just require as you desire. You can also require stylesheets in js require(module_name.css) or in scss/less // @requires: dependency1.scss dependency2.scss.

What is it good for?

The best and most appropriate use case is when you want to make a website fully in javascript, and you do your routing in that javascript. It is not best suited for traditional insert script where you need it sort of web development, but i will probably allow for that in the future.

It runs babel over the concatenated files, which means that you can use babels es6 conventions and that it supports React or jsx just fine.

For now, it runs sass over any scss modules.

In situations where you want to use a 3rd party API, you insert // auto-export object (with no "[]") where object is what you want to export from that library, for example, in React's case we would use // auto-export React and so on..

What do i need to start?

I'm thinking of migrating from Grunt to just plain Nodejs eventually, but for now you can install the plug-in like so:

npm install grunt-chest-compiler --save-dev

And that's all you need to start!

Once the plug-in has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-chest-compiler');

Tasks

chest task

Receives project directory cwd and compiles js files to dest_js nad css files to dest_css.

Options

cwd

Where your main.js (or main.jsx) is located at. All subsequent dependencies must be inside this root folder.

dest_js (path)

The destination directory to compile the js files to. Defaults to bin/js.

dest_css (path)

The destination directory to compile the css files to. Defaults to bin/css.

gzip (true or false)

Should the files be gzipped?

verbose (1, 2 or 3)

Show additional information.

chest_get task

Transfer chest.js to your bin/js. Should be appended to main.js automatically and in the future it will.

Example Gruntfile.js

The following Gruntfile 'chests' every js, jsx, css, scss or sass file in cli/modules to bin.

module.exports = function(grunt) {
  grunt.initConfig({
    'chest': {
      all: { cwd: 'cli/modules/' }
    },
    'chest_get':{
      all: { beautiful:true }
    }
  });

  this.loadNpmTasks('grunt-chest-compiler');

  return this.registerTask('default', ['chest_compiler', 'chest_get']);
};

Just run

grunt

In the console!

1.7.9

9 years ago

1.7.8991

9 years ago

1.7.899

9 years ago

1.7.8981

9 years ago

1.7.898

9 years ago

1.7.897

9 years ago

1.7.896

9 years ago

1.7.895

9 years ago

1.7.894

9 years ago

1.7.893

9 years ago

1.7.892

9 years ago

1.7.891

9 years ago

1.7.89

9 years ago

1.7.88

9 years ago

1.7.87

9 years ago

1.7.86

9 years ago

1.7.85

9 years ago

1.7.83

9 years ago

1.7.82

9 years ago

1.7.81

9 years ago

1.7.8

9 years ago

1.7.791

9 years ago

1.7.79

9 years ago

1.7.78

9 years ago

1.7.77

9 years ago

1.7.76

9 years ago

1.7.75

9 years ago

1.7.74

9 years ago

1.7.732

9 years ago

1.7.731

9 years ago

1.7.73

9 years ago

1.7.72

9 years ago

1.7.71

9 years ago

1.7.7

9 years ago

1.7.692

9 years ago

1.7.691

9 years ago

1.7.69

9 years ago

1.7.68

9 years ago

1.7.67

9 years ago

1.7.66

9 years ago

1.7.65

9 years ago

1.7.64

9 years ago

1.7.63

9 years ago

1.7.62

9 years ago

1.7.61

9 years ago

1.7.6

9 years ago

1.7.59

9 years ago

1.7.58

9 years ago

1.7.57

9 years ago

1.7.56

9 years ago

1.7.55

9 years ago

1.7.54

9 years ago

1.7.53

9 years ago

1.7.52

9 years ago

1.7.51

9 years ago

1.7.5

9 years ago

1.7.42

9 years ago

1.7.41

9 years ago

1.7.4

9 years ago

1.7.31

9 years ago

1.7.3

9 years ago

1.7.28

9 years ago

1.7.271

9 years ago

1.7.26

9 years ago

1.7.25

9 years ago

1.7.24

9 years ago

1.7.23

9 years ago

1.7.22

9 years ago

1.7.21

9 years ago

1.7.2

9 years ago

1.7.0

9 years ago

1.6.9

9 years ago

1.6.8

9 years ago

1.6.7

9 years ago

1.6.6

9 years ago

1.6.5

9 years ago

1.6.4

9 years ago

1.6.3

9 years ago

1.6.2

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.9

9 years ago

1.5.8

9 years ago

1.5.7

9 years ago

1.5.6

9 years ago

1.5.4

9 years ago

1.5.3

9 years ago

1.5.2

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.9

9 years ago

1.4.7

9 years ago

1.4.6

9 years ago

1.4.5

9 years ago

1.4.4

9 years ago

1.4.3

9 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.9

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.9

9 years ago

1.2.8

9 years ago

1.2.7

9 years ago

1.2.6

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7-1

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.0.9

9 years ago

1.0.8-4

9 years ago

1.0.8-1

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago