crafty icon indicating copy to clipboard operation
crafty copied to clipboard

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

Open onigoetz opened this issue 9 months ago • 0 comments

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

https://github.com/microsoft/TypeScript/issues/49842

onigoetz avatar Oct 04 '23 06:10 onigoetz