Skip to content
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

incorrect : The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. #2181

Open
onigoetz opened this issue Oct 4, 2023 · 0 comments

Comments

@onigoetz
Copy link
Member

onigoetz commented Oct 4, 2023

src/index.mts(16,48): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.
  • Running crafty run fails
  • Running yarn tsc succeeds

tsconfig.json

{
  "compilerOptions": {
    "allowJs": false,
    "lib": ["ES2020"],
    "target": "ESNext",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": false,
    "pretty": true,
    "strict": true,
    "sourceMap": true,
    "outDir": "./dist",
    "skipLibCheck": true,
    "noImplicitAny": true,
    "esModuleInterop": true,
    "declaration": false,
    "resolveJsonModule": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": ["node_modules", "node", "css", "etc"],
  "compileOnSave": false
}
module.exports = {
  browsers: "node >= 12",
  presets: [
    "@swissquote/crafty-preset-typescript",
    "@swissquote/crafty-runner-gulp",
    "@swissquote/crafty-preset-jest"
  ],
  js: {
    app: {
      runner: "gulp/typescript",
      source: ["src/*.mts", "src/**/*.mts"],
      inlineRuntime: true
    }
  },
  jest(crafty, options) {
    options.testResultsProcessor = require.resolve("jest-sonar-reporter");
  }
};

references

microsoft/TypeScript#49842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant