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 node_modules
package-lock.json 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 title: Aperture File Types
redirect_from: redirect_from:
# forward slashes are required
- /new-goodies-aperture-file-types-icons/ - /new-goodies-aperture-file-types-icons/
- /goodie-updated-aperture-file-types-v11/ - /goodie-updated-aperture-file-types-v11/
- /aperture-file-types-v12-released/ - /aperture-file-types-v12-released/
- /2008/04/aperture-file-types/ - /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 ## License
The MIT License The MIT License

View File

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

View File

@ -7,18 +7,25 @@
"license": "MIT", "license": "MIT",
"main": "index.js", "main": "index.js",
"scripts": { "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": "./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-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": [ "browserslist": [
"last 3 versions" "last 2 versions"
], ],
"dependencies": { "dependencies": {
"chalk": "^2.4.1" "chalk": "^2.4.1"
}, },
"devDependencies": { "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", "eslint": "^5.4.0",
"release-it": "^7.6.0" "release-it": "^7.6.0"
}, },

View File

@ -1,8 +1,6 @@
'use strict' import chalk from 'chalk'
const chalk = require('chalk') export function createPages({ graphql, actions }) {
exports.createPages = ({ graphql, actions }) => {
const { createRedirect } = actions const { createRedirect } = actions
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -59,7 +57,7 @@ exports.createPages = ({ graphql, actions }) => {
}) })
resolve( 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