Code Monkey home page Code Monkey logo

Comments (7)

Vampire2008 avatar Vampire2008 commented on May 16, 2024

Workaround: add resolve.alias to webpack config:

resolve: {
        alias: {
            "dictionary-en": path.resolve(__dirname, 'node_modules', "dictionary-en"),
            "dictionary-fr": path.resolve(__dirname, 'node_modules', "dictionary-fr")
        }
    }

from dictionaries.

wooorm avatar wooorm commented on May 16, 2024

Please show your code

from dictionaries.

Vampire2008 avatar Vampire2008 commented on May 16, 2024
import * as nspellImport from 'nspell';

import enAff from 'dictionary-en/index.aff';
import enDic from 'dictionary-en/index.dic';

import frAff from 'dictionary-fr/index.aff';
import frDic from 'dictionary-fr/index.dic';

export const nspell = nspellImport;

export const dictionaries = [
    { aff: enAff, dic: enDic },
    { aff: frAff, dic: frDic }
];

It is entry for webpack. Produced file then used in browser to activate nspell and check words.

from dictionaries.

wooorm avatar wooorm commented on May 16, 2024

That is indeed not supported. Did you read the docs?

from dictionaries.

Vampire2008 avatar Vampire2008 commented on May 16, 2024

No. But that code works before you add exports field in package.json.
It works for many years and uses for spell checking.

from dictionaries.

Vampire2008 avatar Vampire2008 commented on May 16, 2024

I am not author of that code. But I support the product where it used.

from dictionaries.

wooorm avatar wooorm commented on May 16, 2024

But that code works before you add exports field in package.json.

There was a major version release.
Adding export maps is intentional. It hides private APIs and only expose public APIs.

This was not documented as working. And it doesn’t work in JS: it’s Webpack-specific.

There is a better documented public API that does work in JavaScript:

import en from 'dictionary-en'
import fr from 'dictionary-fr'

from dictionaries.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.