electron-userland / electron-prebuilt-compile

electron-prebuilt with Babel and React built-in
167 stars 50 forks source link

Unknown option: base.main #10

Open zeke opened 8 years ago

zeke commented 8 years ago

This seems related to https://github.com/paulcbetts/electron-prebuilt-compile/issues/7 in that npm start throws an error, but electron . does not.

$ npm ls electron-prebuilt-compile
/Users/zeke/zeke/ummoji
└── electron-prebuilt-compile@1.4.1 
$ cat main.js                     
const {app, BrowserWindow} = require('electron')
let win

app.on('ready', () => {
  let opts = {
    frame: false,
    transparent: true,
    width: 600
  }

  win = new BrowserWindow(opts)
  win.loadURL(`file://${__dirname}/app/index.html`)
})
$ npm start                       

> @ start /Users/zeke/zeke/ummoji
> electron .

App threw an error during load
ReferenceError: [BABEL] /Users/zeke/zeke/ummoji/main.js: Unknown option: base.main. Check out http://babeljs.io/docs/usage/options/ for more info
    at Logger.error (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
    at OptionManager.mergeOptions (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:20)
    at OptionManager.init (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/options/option-manager.js:359:12)
    at File.initOptions (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/index.js:221:65)
    at new File (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/index.js:141:24)
    at Pipeline.transform (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at BabelCompiler.compileSync (/Users/zeke/zeke/ummoji/node_modules/electron-compilers/lib/js/babel.js:225:21)
    at CompilerHost.compileUncachedSync (/Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compiler-host.js:782:29)
    at /Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compiler-host.js:756:23
    at CompileCache.getOrFetchSync (/Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compile-cache.js:456:20)
^C
$ electron .                      
(App is now running fine)
^C