mapbox / mapbox-gl-rtl-text

Add right-to-left text support to Mapbox GL JS
Other
53 stars 20 forks source link

import with webpack is not working #18

Open kappaxbeta opened 5 years ago

kappaxbeta commented 5 years ago

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

PhilippBaschke commented 4 years ago

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'
        }
      ]
    }
  ]
}
zedam commented 4 years ago

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"