0.1.2 • Published 7 years ago

paper-loader v0.1.2

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

PaperJS loader for webpack

Install

npm install paper-loader paper --save-dev

The paper-loader requires paper and webpack as a peerDependency. Thus you are able to specify the required versions accurately.


Usage

Documentation: Using loaders

var executePaperScript = require('file.paper.js');

// Wait for canvas to be created
window.onload = function () {
  // Call the module to create a paperjs scope and execute the code
  var scope = executePaperScript('myCanvasID');
}

The module returns a function that can be called to create a PaperJS Scope. It takes one parameter that sets up the view, and returns the scope created.

Apply via webpack config

module.exports = {
  ...
  module: {
    loaders: [
      {
        test: /\.paper.js$/,
        loader: "paper-loader"
      }
    ]
  }
};

License

MIT