electron-webpack icon indicating copy to clipboard operation
electron-webpack copied to clipboard

How can use babel decorator ? Error in need decoratorsBeforeExport option

Open zacard-orc opened this issue 5 years ago • 2 comments

"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!

zacard-orc avatar Aug 31 '20 12:08 zacard-orc

Same error here....

pgsteven avatar Oct 28 '20 13:10 pgsteven

Found the solution in https://github.com/electron-userland/electron-webpack/issues/251#issuecomment-504693323

pgsteven avatar Oct 28 '20 13:10 pgsteven