mapbox-gl-rtl-text icon indicating copy to clipboard operation
mapbox-gl-rtl-text copied to clipboard

import with webpack is not working

Open kappaxbeta opened this issue 6 years ago • 2 comments

Hello together,

I tried to import it with webpack via import mapboxglRTL from '@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text';

Webpack give me then following error:

ERROR in ./node_modules/@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js
Module not found: Error: Can't resolve 'fs' in 'project/node_modules/@mapbox/mapbox-gl-rtl-text'

using Version 0.2.1

kappaxbeta avatar Feb 20 '19 10:02 kappaxbeta

I worked around it by using the following import:

import mapboxglRTL from '@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js';

in combination with a rule in module.rules:

module: {
  rules: [
    {
      test: /mapbox-gl-rtl-text.min.js$/,
      use: [
        {
          loader: 'file-loader'
        }
      ]
    }
  ]
}

PhilippBaschke avatar Nov 22 '19 09:11 PhilippBaschke

Trying to use it in a ThreeJs Project in order to create TextGeomtry in arabic text...

Using Webpack but I get this error and I don't know how to make it work... I already added @PhilippBaschke fix, but I get:

mapbox_mapbox_gl_rtl_text_mapbox_gl_rtl_text_min_js__WEBPACK_IMPORTED_MODULE_7_.default.applyArabicShaping is not a function

any suggestion? Thanks!!

using "^0.2.3"

zedam avatar Oct 27 '20 23:10 zedam