Last updated at
warning
この記事は最終更新から3年以上経っています。情報が古くなっている可能性が高いです。
webpackで運用しているプロジェクトでlocalForageを使おうとしたらエラーが出たのでメモ。
./node_modules/localforage/dist/localforage.js
Module build failed: ReferenceError: Unknown plugin "add-module-exports" specified in "/app/node_modules/localforage/.babelrc" at 0, attempted to resolve relative to "/app/node_modules/localforage"
localforageに既に上がっているIssue(#599)とは別物。
Babelが原因のエラーのようなので、
webpack.config.js
のbabel-loader
に読み込ませないようにする。
// webpack.config.js
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader?presets=es2015',
exclude: /localforage/,
},
],
},
https://stackoverflow.com/questions/45244723/how-to-use-noparse-in-webpack