Lindera WASM with Korean dictionary (ko-dic) (bundler target)
npm install lindera-wasm-ko-dic-bundlerWebAssembly of Lindera
!Screenshot from 2025-09-13 23-05-49
-
-
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Web
-
Lindera WASM with Japanese dictionary (IPADIC) for Web
-
Lindera WASM with Japanese dictionary (UniDic) for Web
-
Lindera WASM with Korean dictionary (ko-dic) for Web
-
Lindera WASM with Chinese dictionary (CC-CEDICT) for Web
-
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Node.js
-
Lindera WASM with Japanese dictionary (IPADIC) for Node.js
-
Lindera WASM with Japanese dictionary (UniDic) for Node.js
-
Lindera WASM with Korean dictionary (ko-dic) for Node.js
-
Lindera WASM with Chinese dictionary (CC-CEDICT) for Node.js
init the wasm module before construct TokenizerBuilder:
``ts
import __wbg_init, { TokenizerBuilder } from 'lindera-wasm'
__wbg_init.then(() => {
const builder = new TokenizerBuilder()
//...
})
`
You should exclude this package in the optimizeDeps:
`ts
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
optimizeDeps: {
exclude: [
"lindera-wasm"
]
},
})
`
Set the cors config in vite.config.js
`ts
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
server: {
cors: {
origin: [
/chrome-extension:\/\//,
],
},
},
})
`
and set the content_security_policy to contains wasm-unsafe-eval in manifest.json:
`json`
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval';"
}
- wasm-pack :
`shell`Clone the Lindera project repository
% git clone git@github.com:lindera/lindera.git
% cd lindera
`shell`
% make wasm-build
`shell`
% make wasm-test
`shell`
% cd example && npm install && npm run build && cp index.html dist/index.html
`shell``
% cd example && npm run start