Skip to content

aprowe/paper-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published