feat(build): Added npm run build:normal script

This commit is contained in:
Daniel Gonzalez
2020-06-10 21:35:22 -04:00
parent a914f54b0f
commit e76a9230b6
3 changed files with 64 additions and 31738 deletions
+63 -30
View File
@@ -1,3 +1,65 @@
const ipfsPrefix = process.argv.find(val=> val === '--prefix-paths')
const ipfsConfig =[
'gatsby-plugin-ipfs',
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
start_url: '__GATSBY_IPFS_PATH_PREFIX__',
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: '__GATSBY_IPFS_PATH_PREFIX__',
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
]
const normalConfig=[
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
start_url: '/',
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: '/',
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
]
module.exports = {
siteMetadata: {
title: `Gatsby IPFS Adminlte Starter`,
@@ -5,34 +67,5 @@ module.exports = {
author: `@gatsbyjs`,
},
pathPrefix: '__GATSBY_IPFS_PATH_PREFIX__',
plugins: [
'gatsby-plugin-ipfs',
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
start_url: '__GATSBY_IPFS_PATH_PREFIX__',
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: '__GATSBY_IPFS_PATH_PREFIX__',
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
plugins: ipfsPrefix ? ipfsConfig : normalConfig,
}
-31708
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -28,6 +28,7 @@
"license": "MIT",
"scripts": {
"build": "gatsby build --prefix-paths",
"build:normal": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",