signature_pad: Doesn't seem to support Webpack
I’m using Webpack to bundle my app and I’m trying to integrate SignaturePad. I tried using
import { SignaturePad } from "signature_pad", import "signature_pad", require("signature_pad") and many other variations, with “signature_pad/signature_pad”, and even “signature_pad/src/signature_pad”, but it seems that Webpack doesn’t support the module types that SignaturePad uses.
The only way I got it to work is using exports-loader:
var SignaturePad = require("exports?SignaturePad!signature_pad/src/signature_pad");
Any plans to add Webpack support? Or am I missing something?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 44 (21 by maintainers)
I’ve just published a new beta version (
1.6.0-beta.6) that hopefully fixes loading it with webpack. I tried it locally with webpack 2.x and bothimport SignaturePad from 'signature_pad'andconst SignaturePad = require('signature_pad')worked fine.I rewrote the build script completely to use gulp and rollup and it generates 3 builds now - umd for webpack 1.x, <script> tags etc., minified version of umd and es6 build for webpack 2.x, rollup etc.
Let me know if it works.