Last active
June 18, 2018 08:36
-
-
Save donkeybanana/9d6bab2769a054b9e76c4e9b8065fae1 to your computer and use it in GitHub Desktop.
stealjs issue with object spread syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var babel = require('babel-core'); | |
var stealTools = require('steal-tools'); | |
const babelOpts = { | |
sourceMaps: true, | |
presets: ['env', 'stage-0', 'react'], | |
plugins: ['transform-object-rest-spread'] | |
}; | |
const result = babel.transformFileSync(__dirname + '/index.js', babelOpts); | |
console.log(result.code); | |
console.log('=== Done with babel ==='); | |
console.log("=== Steal's turn... ==="); | |
stealTools.build( | |
{ | |
main: 'index', | |
babelOptions: { | |
...babelOpts, | |
env: { | |
production: babelOpts | |
} | |
}, | |
baseUrl: '.' | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<script type="text/javascript" | |
data-main="index" | |
src="node_modules/steal/steal.js" | |
></script> | |
<script type="text/javascript"> | |
steal.done().then(([Module]) => console.log(Module.default)); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const butter = function(o) { | |
return { | |
...o | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0.0", | |
"name": "steal-spread", | |
"dependencies": { | |
"babel-core": "^6.26.3", | |
"steal": "^1.12.0", | |
"steal-tools": "^1.11.9", | |
"babel-plugin-transform-object-rest-spread": "^6.26.0", | |
"babel-preset-env": "^1.7.0", | |
"babel-preset-react": "^6.24.1", | |
"babel-preset-stage-0": "^6.24.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment