JSPM

paper-loader

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q31226F
  • License MIT

Paperjs loader for webpack

Package Exports

  • paper-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (paper-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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