electron-compile
electron-compile copied to clipboard
JS file with a unique export (not default) is invalid
I have the following selectors.js file
export const isUpdateAvailable = state => state.getIn(['auto_update', 'updateAvailable']);
When I try to import it import { isUpdateAvailable } from 'selectors'
, electron (in a renderer) complains that it does not know export
keyword.
If I try to add a second export in that file, not more error (with the same import)
export const isUpdateAvailable = state => state.getIn(['auto_update', 'updateAvailable']);
export const dummy = null;
Any ideas ?
my .compilerc
{
"text/scss": {},
"application/javascript": {
"presets": [
"react",
"es2017-node7"
],
"plugins": [
"add-module-exports",
"transform-async-to-generator",
"transform-decorators-legacy"
],
"env": {
"production": {
"plugins": [
"babel-plugin-dev-expression"
]
},
"development": {
"plugins": [
"react-hot-loader/babel"
]
}
}
}
}
I'm having the same issue, did you end up fixing this?
@liamaharon I think the issue still isn't fixed. For the project which we having the issue, we now have mostly TypeScript files now in our codebase, and those work fine.