Last active
May 27, 2022 16:47
Revisions
-
wickedst revised this gist
Mar 7, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "build": "next build", "now-build": "next build", "start": "CHOKIDAR_USEPOLLING=true node server.js" }, "keywords": [], -
wickedst revised this gist
Mar 7, 2019 . No changes.There are no files selected for viewing
-
wickedst revised this gist
Mar 7, 2019 . 2 changed files with 28 additions and 22 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,41 @@ // just adds target: "serverless" const path = require('path'); const glob = require('glob'); module.exports = { webpack: config => { config.module.rules.push( { test: /\.(css|scss)/, loader: 'emit-file-loader', options: { name: 'dist/[path][name].[ext]', }, }, { test: /\.css$/, use: ['babel-loader', 'raw-loader', 'postcss-loader'], }, { test: /\.s(a|c)ss$/, use: [ 'babel-loader', 'raw-loader', 'postcss-loader', { loader: 'sass-loader', options: { includePaths: ['styles', 'node_modules'] .map(d => path.join(__dirname, d)) .map(g => glob.sync(g)) .reduce((a, c) => a.concat(c), []), }, }, ], }, ); return config; }, target: "serverless" }; This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // uses next routes config instead of express server.js (server.js still used for development) { "version": 2, "name": "headless-wp-starter", -
wickedst revised this gist
Mar 7, 2019 . 2 changed files with 59 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ { "version": 2, "name": "headless-wp-starter", "builds": [ { "src": "next.config.js", "use": "@now/next" } ], "routes": [ { "src": "/post/(?<slug>[^/]+)$", "dest": "/post?slug=$slug&apiRoute=post" }, { "src": "/page/(?<slug>[^/]+)$", "dest": "/page?slug=$slug&apiRoute=page" }, { "src": "/(.*)$", "dest": "/$1" } ], "env": { "NODE_ENV": "production" } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ { "name": "frontend", "version": "2.0.0", "description": "", "main": "index.js", "scripts": { "build": "next build", "now-build": "next build" "start": "CHOKIDAR_USEPOLLING=true node server.js" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "express": "^4.16.4", "isomorphic-unfetch": "^3.0.0", "next": "7.0.2", "react": "^16.7.0", "wpapi": "^1.2.1", "autoprefixer": "9.4.7", "postcss-easy-import": "^3.0.0", "glob": "^7.1.3", "axios": "^0.18.0" }, "devDependencies": { "eslint": "^5.13.0", "babel-eslint": "^10.0.1", "eslint-config-airbnb": "^17.1.0", "eslint-config-prettier": "^4.0.0", "eslint-plugin-import": "^2.16.0", "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", "babel-plugin-module-resolver": "^3.1.3", "babel-plugin-wrap-in-js": "^1.1.0", "node-sass": "^4.11.0", "normalize.css": "^8.0.1", "postcss-loader": "^3.0.0", "raw-loader": "^1.0.0", "react-dom": "^16.7.0", "sass-loader": "^7.1.0", "webpack": "^4.29.0" } } -
wickedst revised this gist
Mar 7, 2019 . No changes.There are no files selected for viewing
-
wickedst created this gist
Mar 7, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ const path = require('path') const glob = require('glob') module.exports = { webpack: (config, { dev }) => { config.module.rules.push( { test: /\.(css|scss)/, loader: 'emit-file-loader', options: { name: 'dist/[path][name].[ext]' } } , { test: /\.css$/, use: ['babel-loader', 'raw-loader', 'postcss-loader'] } , { test: /\.s(a|c)ss$/, use: ['babel-loader', 'raw-loader', 'postcss-loader', { loader: 'sass-loader', options: { includePaths: ['styles', 'node_modules'] .map((d) => path.join(__dirname, d)) .map((g) => glob.sync(g)) .reduce((a, c) => a.concat(c), []) } } ] } ) return config }, target: "serverless" }