TypeScript files are not minified during build (gatsby-plugin-typescript)
See original GitHub issueWhen 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@1.9.119
- node v8.2.1
- macOS Sierra 10.12.6
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 <mathews.kyle@gmail.com>",
"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"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Is it possible to compile TypeScript into minified code?
The TypeScript compiler does not support the generation of minifies or obfuscated code. you will need to use another tool against the JavaScript...
Read more >gatsby-plugin-minify
A Gatsby plugin to easily minify all output HTML files. Installation. $ npm install gatsby-plugin-minify # or yarn $ ...
Read more >Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >Create Source Maps in TypeScript: Inline or File
So we'll need to debug what those original files look like, and where. This is not something you'd create yourself, we would use...
Read more >The great gatsby upgrade - Scott Nonnenberg
In the past year I've upgraded this blog's version of Gatsby not ... Gatsby 3.0 made this easier: gatsby-plugin-typescript plugin is now ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My fault - I updated gatsby but not gatsby-plugin-typescript.
Confirming that it works as expected with
Hm… it might be issue with tsconfig.
For me it’s working fine with: