electron-userland / electron-userland/electron-webpack

How can use babel decorator ? Error in need decoratorsBeforeExport option

Open
#401 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

"electron-builder": "^22.4.1",
"electron-webpack": "^2.8.2",

* **Version**:
electron 10+
osx 10.14+

* **Target**: osx

ERROR in ./src/renderer/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/lin/Documents/mylab/electron-webpack-quick-start/src/renderer/index.js: The decorators plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you want to use the legacy decorators semantics, you can set the 'legacy: true' option. (While processing: "base$2")

so i have to modify deco lib
```
const {
legacy = false
} = options;

if (typeof legacy !== "boolean") {
throw new Error("'legacy' must be a boolean.");
}

const {
decoratorsBeforeExport = false
} = options;
```
and no error

additional ,where can i set the babel.config.js in this repo

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.