LoginSignup
3
0

More than 5 years have passed since last update.

Invalid Option: corejs is not a valid top-level option が出る

Posted at

circle ciで動かしているwebpackのbuildが落ちる

babelrcの corejs はトップレベルでは使えないオプションだ、みたいなことを言われる

ERROR in ./src/index.jsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] /home/circleci/project/src/index.jsx: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? 

babelは7を入れており、babelrcの設定はこんな感じだが、ローカルの開発環境でbuildしてもエラーは出ない。

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "browsers": [
            "last 2 versions",
            "ie >= 11"
          ]
        },
        "useBuiltIns": "usage",
        "corejs": 3
      }
    ],

circle ciで実行していた npm installnpm ci に変更し、現在の package.lock.json.gitignore から削除して再度circle ciを回したらビルドが通るようになった。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0