wordpos-web icon indicating copy to clipboard operation
wordpos-web copied to clipboard

Webpack usage?

Open mirryi opened this issue 4 years ago • 0 comments

Is it possible to bundle wordpos and the WordNet data files with Webpack? I've tried the following configuration, but it fails to resolve the index files when run.

webpack.config.js:

resolve: {
  alias: {
    "wordpos-web": path.resolve(__dirname, "node_modules/wordpos-web/dist/wordpos.min.js")
  }
}

WordPOS construction:

import WordPOS from "wordpos-web"

let wordpos = new WordPOS({
  dictPath: "../../../node_modules/wordpos-web/dict", // also tried "../dict"
});

I tried importing the index files so they would be bundled:

import "../../../node_modules/wordpos-web/dict/index.adv.js"
import "../../../node_modules/wordpos-web/dict/index.noun.js"

mirryi avatar Apr 30 '20 01:04 mirryi