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

[v2] provide non-traspiled version of default-html.js to copy from #6102

Closed
ng-hai opened this issue Jun 22, 2018 · 3 comments · Fixed by #6183
Closed

[v2] provide non-traspiled version of default-html.js to copy from #6102

ng-hai opened this issue Jun 22, 2018 · 3 comments · Fixed by #6183
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@ng-hai
Copy link
Contributor

ng-hai commented Jun 22, 2018

Description

I want to customize html.js but the default-html.js file is transpiled to ES5 by default.

Steps to reproduce

Install all the dependencies from package.json using yarn, run gatsby develop, it will generate .cache folder.

Copy the default-html.js in .cache folder to src/html.js

cp .cache/default-html.js src/html.js

Expected result

The content of default-html.js should be ES6, not be transpiled by default.

Actual result

The content of html.js is not ES6

Environment

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.11.1 - /usr/local/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 5.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 67.0.3396.87
    Safari: 11.1.1
  npmPackages:
    gatsby: next => 2.0.0-beta.9
    gatsby-plugin-no-sourcemaps: next => 2.0.0-beta.2
    gatsby-plugin-react-helmet: next => 3.0.0-beta.2
    gatsby-plugin-styled-components: next => 3.0.0-beta.2

File contents (if changed)

gatsby-config.js:

module.exports = {
  plugins: [
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-styled-components',
    'gatsby-plugin-no-sourcemaps',
  ],
}

package.json:

  "dependencies": {
    "babel-plugin-styled-components": "^1.5.1",
    "gatsby": "next",
    "gatsby-plugin-no-sourcemaps": "next",
    "gatsby-plugin-react-helmet": "next",
    "gatsby-plugin-styled-components": "next",
    "prop-types": "^15.6.2",
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-feather": "^1.1.0",
    "react-helmet": "^5.2.0",
    "react-router-dom": "^4.3.1",
    "sanitize.css": "^5.0.0",
    "styled-components": "^3.3.3"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.3",
    "eslint": "^4.19.1",
    "eslint-config-standard": "^11.0.0",
    "eslint-config-standard-react": "^6.0.0",
    "eslint-plugin-import": "^2.12.0",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.8.0",
    "eslint-plugin-react": "^7.9.1",
    "eslint-plugin-standard": "^3.1.0"
  },
  "scripts": {
    "build": "gatsby build",
    "start": "gatsby develop --https"
  },

gatsby-node.js:

const { resolve } = require('path')

exports.createPages = ({ actions }) => {
  const { createPage } = actions

  createPage({
    path: '/',
    matchPath: '/:path',
    component: resolve(__dirname, './src/app.js'),
  })
}

gatsby-browser.js: N/A
gatsby-ssr.js: N/A

@pieh pieh added the type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change label Jun 22, 2018
@pieh
Copy link
Contributor

pieh commented Jun 22, 2018

Right - this was one of the changes in v2.

Need to figure out nice way of supplying default-html.js to copy from to release now. For now You can grab source version from here https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/cache-dir/default-html.js .

@pieh pieh changed the title [v2] default-html.js is transpiled [v2] provide non-traspiled version of default-html.js to copy from Jun 22, 2018
@jeffwillette
Copy link
Contributor

Would it be possible to just dump a comment with a link to the source, or maybe a comment with a note and the full untranspiled file for people to copy out?

@pieh
Copy link
Contributor

pieh commented Jun 30, 2018

@deltaskelta #6183 will fix this this (revert to use use non transpiled version of files in cache-dir)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants