tatsy / markdown-it-imsize

markdown-it plugin for size-specified image markups.
46 stars 93 forks source link

Unable to make it work using browserify #8

Open MathieuMorrissette opened 6 years ago

MathieuMorrissette commented 6 years ago

Tried bundling this plugin with browserify and I keep getting errors like 'Error: Cannot find module './types/bmp''.

Do you guys know a workaround or something?

Best regards

MathieuMorrissette commented 6 years ago

also tried using webpack and I kept getting errors with fs module

EasonYou commented 6 years ago

The same issue

Danita commented 6 years ago

Same here on Webpack:

Module not found: Error: Can't resolve 'fs' in '/var/... .../node_modules/markdown-it-imsize/lib/imsize'

pjlong commented 6 years ago

Following this thread, adding the following to webpack config seems to work:

node: {
  fs: 'empty'
}
Be1zebub commented 1 month ago

Same on Svelte (vite bundler) Error: Module not found in bundle: ./types/bmp

btw use /dist/markdown-it-imsize.min.js if you need version for browsers, it works good without browserify.

upd: solved with import markdownit_imsize from "markdown-it-imsize/dist/markdown-it-imsize.js" instead import markdownit_imsize from "markdown-it-imsize"