1
0
mirror of https://github.com/kremalicious/gatsby-redirect-from.git synced 2024-12-22 09:13:20 +01:00

babelify build

This commit is contained in:
Matthias Kretschmann 2018-08-30 13:12:47 +02:00
parent 53043c82f8
commit 97875d475f
Signed by: m
GPG Key ID: 606EEEF3C479A91F
7 changed files with 37 additions and 11 deletions

5
.babelrc Normal file
View File

@ -0,0 +1,5 @@
{
"presets": [
["@babel/env"]
]
}

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules
package-lock.json
/*.js

View File

@ -35,14 +35,30 @@ In your Markdown file's YAML frontmatter, use the key `redirect_from` followed b
---
title: Aperture File Types
redirect_from:
# forward slashes are required
- /new-goodies-aperture-file-types-icons/
- /goodie-updated-aperture-file-types-v11/
- /aperture-file-types-v12-released/
- /2008/04/aperture-file-types/
# note: forward slashes are required
---
```
## Development
```bash
npm i
npm start
# production build
npm run build
# publishing to npm & GitHub releases
# uses https://github.com/webpro/release-it
npm run release
npm run release-minor
npm run release-major
```
## License
The MIT License

View File

@ -1,2 +0,0 @@
// noop
'use strict'

View File

@ -7,18 +7,25 @@
"license": "MIT",
"main": "index.js",
"scripts": {
"test": "eslint ./*.js",
"build": "babel src --out-dir . --ignore __tests__",
"start": "babel -w src --out-dir . --ignore __tests__",
"test": "eslint ./src/**/*.js",
"release": "./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --npm.publish --non-interactive",
"release-minor": "./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --npm.publish --non-interactive",
"release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive"
"release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive",
"prepublishOnly": "cross-env NODE_ENV=production npm run build"
},
"browserslist": [
"last 3 versions"
"last 2 versions"
],
"dependencies": {
"chalk": "^2.4.1"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"cross-env": "^5.2.0",
"eslint": "^5.4.0",
"release-it": "^7.6.0"
},

View File

@ -1,8 +1,6 @@
'use strict'
import chalk from 'chalk'
const chalk = require('chalk')
exports.createPages = ({ graphql, actions }) => {
export function createPages({ graphql, actions }) {
const { createRedirect } = actions
return new Promise((resolve, reject) => {
@ -59,7 +57,7 @@ exports.createPages = ({ graphql, actions }) => {
})
resolve(
console.log(`${chalk.green('success')} Create redirects`) // eslint-disable-line no-console
console.log(`${chalk.green('success')} create redirects`) // eslint-disable-line no-console
)
})
)

1
src/index.js Normal file
View File

@ -0,0 +1 @@
// noop