You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2019. It is now read-only.
I am trying to run a one-off script - in this case, a graphql schema generator. My script loads the schema and prints out the .json and .graphql files. The schema is also loaded by fusion at runtime.
Current behavior
Because I don't have a babel config (fusion handles this), my script can't run, and can't require anything that is written thinking it will be transpiled.
Expected behavior
I could create my own .babelrc like normal, install babel-cli, etc., but I was hoping for consistency to be able to run it through the exact same config fusion uses to build.
Steps to reproduce
create a file, src/one-off-script.js
add something that needs to be transpiled in the file, like import ...
run script, node src/one-off-script.js
Your environment
fusion-cli version: 1.8.4
Node.js version (node --version): 8.11.3
npm version (npm --version): yarn 1.9.2
Operating System: a mess - WSL/ubuntu at work (lol)
The text was updated successfully, but these errors were encountered:
I think this brings up a use case we might want to add support for. While a custom babel config is an okay workaround, we should probably think about exposing some form of API to make this possible, especially as we start introducing more virtual modules such as createUniversalSymbol which we talked about today (cc @rtsao).
@joenoon You might be interested in fusionjs/rfcs#7. Also would you mind expanding on how the code generation stuff works? Are you using a specific babel plugin? What does your script do?
I think the point is if you want to have a script that uses any of your application code, you probably want to build it the same way. Especially if it have references to __NODE__, __DEV__, etc.
Type of issue
Feature request
Description
I am trying to run a one-off script - in this case, a graphql schema generator. My script loads the schema and prints out the .json and .graphql files. The schema is also loaded by fusion at runtime.
Current behavior
Because I don't have a babel config (fusion handles this), my script can't run, and can't require anything that is written thinking it will be transpiled.
Expected behavior
I could create my own .babelrc like normal, install babel-cli, etc., but I was hoping for consistency to be able to run it through the exact same config fusion uses to build.
Steps to reproduce
import ...
node src/one-off-script.js
Your environment
fusion-cli version: 1.8.4
Node.js version (
node --version
): 8.11.3npm version (
npm --version
): yarn 1.9.2Operating System: a mess - WSL/ubuntu at work (lol)
The text was updated successfully, but these errors were encountered: