ApeironTsuka / node-webpmux

A mostly 1:1 re-implementation of webpmux as a Node module in pure Javascript. Only thing currently missing is a command-line version.
GNU Lesser General Public License v3.0
21 stars 8 forks source link

Can't Webpack #8

Open StarrHelixx opened 3 years ago

StarrHelixx commented 3 years ago

Hey, thanks for developing this library! I'm trying to implement it in my app so I can check the duration of WebP files. However, I seem to be having an issue getting my build to work properly, as I get the following error:

 ERROR in ./node_modules/node-webpmux/webp.js 59:7
    Module parse failed: Unexpected token (59:7)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    | }
    | class WebPReader {
    >   type = intfTypes.NONE;
    |   readFile(path) { this.type = intfTypes.FILE; this.path = path; }
    |   readBuffer(buf) { this.type = intfTypes.BUFFER; this.buf = buf; this.cursor = 0; }
     @ ./src/renderer/components/player/ImagePlayer.tsx 6:0-32 681:30-34
     @ ./src/renderer/components/player/SourceScraper.tsx
     @ ./src/renderer/components/player/Player.tsx
     @ ./src/renderer/components/Meta.tsx
     @ ./src/renderer/renderer.tsx

I'm not sure what it is about that line which is messing up my webpack .... any ideas?

ApeironTsuka commented 3 years ago

My guess is the Webpack parser doesn't know how to handle field declarations. I'll push a quick change (they're basically just shorthand so I don't need a constructor) and see if it works for you.