Skip to content

TypeScript files are not minified during build (gatsby-plugin-typescript)Β #3022

@tomazy

Description

@tomazy

When running npm run build all typescript files are converted into non-minified javascript files in the public folder.

Example based on Gatsby default starter: https://github.com/tomazy/gatsby-site-typescript-issue (see the public folder)

Environment:

gatsby-config.js

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-typescript`,
  ],

package.json

{
  "name": "gatsby-starter-default",
  "description": "Gatsby default starter",
  "version": "1.0.0",
  "author": "Kyle Mathews <[email protected]>",
  "dependencies": {
    "@types/node": "8.0.53",
    "@types/prop-types": "15.5.2",
    "@types/react": "16.0.25",
    "@types/react-dom": "16.0.3",
    "@types/react-helmet": "5.0.3",
    "@types/react-router-dom": "4.2.2",
    "gatsby": "^1.9.119",
    "gatsby-link": "^1.6.28",
    "gatsby-plugin-react-helmet": "^1.0.8",
    "gatsby-plugin-typescript": "1.4.10"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "prettier": "^1.8.2"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions