observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
959 stars 83 forks source link

Import the observablehq in a Vue project using webpack #269

Closed Sheldon04 closed 2 years ago

Sheldon04 commented 2 years ago

I tried to load the js files with babel-loader, but it came with the following problem:

error in ./node_modules/@observablehq/stdlib/src/library.js

Module parse failed: Unexpected token (25:61) You may need an appropriate loader to handle this file type. | FileAttachment: () => NoFileAttachments, | Arrow: () => require(arrow.resolve()), | Inputs: () => require(inputs.resolve()).then(Inputs => ({...Inputs, file: Inputs.fileOf(AbstractFile)})), | Mutable: () => Mutable, | Plot: () => require(plot.resolve()),

mbostock commented 2 years ago

Sorry, but I don’t know how to debug this.