-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enableTypeScript function always skipProject set true #345
Comments
imjuni
changed the title
TS_NODE_PROJECT environment not pass for ts-node
Apr 2, 2020
Unexpected token '?'
from just.config.ts
imjuni
changed the title
Unexpected token '?' from just.config.ts
Apr 2, 2020
Unexpected token '?'
from just.config.ts
imjuni
changed the title
Unexpected token '?' from just.config.ts
enableTypeScript function always skipProject set true
Apr 2, 2020
I use just.config.ts file below, task('hello', async () => {
const envObj: { [key: string]: string } = {
DEBUG: 'tjscli:*',
TS_NODE_PROJECT: './tsconfig.prod.json',
};
const env = Object.entries(
Object.keys(envObj).reduce<{ [key: string]: string | undefined }>((obj, key) => {
// obj[key] = process.env[key] !== undefined ? process.env[key] : envObj[key];
obj[key] = process.env[key] ?? envObj[key];
return obj;
}, {}),
)
.map(([key, value]) => `${key}=${value}`)
.join(' ');
}); ts-node compiler cannot compile nullish coalescing operator. Because enableTypeScript function set skipProject always set true. function enableTypeScript({ transpileOnly = true }) {
const tsNodeModule = resolve_1.resolve('ts-node');
if (tsNodeModule) {
const tsNode = require(tsNodeModule);
tsNode.register({
transpileOnly,
skipProject: true,
compilerOptions: {
target: 'esnext', // this line cause problem I think change below function enableTypeScript({ transpileOnly = true }) {
const tsNodeModule = resolve_1.resolve('ts-node');
if (tsNodeModule) {
const tsNode = require(tsNodeModule);
tsNode.register({
transpileOnly,
skipProject: ture,
compilerOptions: {
target: 'es2017', // this line cause problem finally I found problem and solution. I system below,
Node.js 12.14.1 ~ 12.16.1 not support ?? operator. I have to use stable version of Node.js. Because AWS only support 12.16.1. Any idea? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thank you for best task runner development,
I want to use just.config .ts not just.config .js
But just-script not pass TS_NODE_PROJECT environment variable to internal ts-node processor.
This cause error from nullish operator in just.config.ts
How can I pass TS_NODE_PROJECT to just-scripts?
The text was updated successfully, but these errors were encountered: