Skip to content

plugin works only once #13

@sylver

Description

@sylver

Once installed the plugin works as expected (loading my .env vars in process.env being used in webpack and all), but after a node reload or any changes, it suddenly stops to populate process.env.

I can make it to "work" again either by changing in .babelrc the path option value (which I should not need, my .env is at the root of my repository) or by running a new yarn install --dev babel-plugin-inline-dotenv to clean it up, which makes me wondered if there's some sort of cache messing up here ?
Once it stops working for a specific .env path, it won't use it again no matter what until reinstalled.

node version : 9.11.1

package.json (relevant part)

"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"@babel/node": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-react": "^7.0.0-beta.42",
"@babel/preset-stage-0": "^7.0.0-beta.42",
"@babel/register": "^7.0.0-beta.42",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-inline-dotenv": "^1.1.2",
"babel-plugin-transform-require-ignore": "^0.1.1",

.babelrc

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react",
    "@babel/preset-stage-0"
  ],
  "plugins": [
    ["inline-dotenv"]
  ],
  "env": {
    "development": {
      "plugins": [
        "react-hot-loader/babel"
      ]
    },
    "node": {
      "plugins": [
        "dynamic-import-node",
        [
          "transform-require-ignore",
          {
            "extensions": [".sass", ".scss", ".less"]
          }
        ]
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions