mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
* chore(deps): upgrade TS packages * build(ts): use tsc to compile * refactor(ts): move some files to TS * chore: implement SkyPack check suggestions * chore(ci): temprarily disable tests * chore: add PR comment action * chore: add determine version github action * chore: prefix with env. * chore: add runs to action * chore: change runs.using to node12 * chore: fix typo * chore: install @actions/core as dev dependency * chore: move env var, remove old script * chore: change version comment message * refactor(ts): convert server/index.js to TS * chore: fix `types` path * chore: fix paths * refactor(ts): convert `next-auth/react` * refactor(ts): convert `next-auth/jwt` to TS * chore: fix import * refactor: move `types` into `src` * refactor(ts): fix types imports * chore: add cleanup script * chore: exclude all `tests` folder from compilation * refactor: rename types/index.d.ts to types/index.ts * refactor(ts): move `next-auth/jwt` * refactor(ts): move `next-auth/providers` * chore(ts): fix `next-auth` types * refactor(ts): change internal import paths * test(ts): remove type tests * chore: remove test:types script * refactor(ts): move more code to TypeScript * refactor: fix some imports * refactor(ts): move error module into server * fix(ts): add type to .js providers * chore: rename adapters.ts to adapters.d.ts * fix: update exports field * chore: add files that should end up on npm * chore: add stricter lib checking * refactor(ts): remove unnecessary files, fix imports * chore: autocomplete env variables * fix: add css folder to npm files * fix: fix CSS import/generation * feat: log provider when authorization url error happens * refactor(ts): turn pages into .tsx * chore: compile differently for client/server * refactor(ts): move server file to TS * chore: add back node target * chore: add back comment removal * chore: re-enable tests * chore: ignore test files when building * chore(ts): refactor files to TS * chore(ts): fix imports * chore(ts): more ts * fix(ts): correctly type _NEXTAUTH_DEBUG env var * chore: don't generate internals module iwth babel * fix(ts): better `clientId`, `clientSecret` constraints * refactor(ts): move facebook provider to TS * refactor(ts): apply suggested changes * chore(ts): strip internal types from compilation * refactor(ts): move server types to server folder * refactor(ts): rename internals to types
18 lines
789 B
JavaScript
18 lines
789 B
JavaScript
// Serverless target in Next.js does not work if you try to read in files at runtime
|
|
// that are not JavaScript or JSON (e.g. CSS files).
|
|
// https://github.com/nextauthjs/next-auth/issues/281
|
|
//
|
|
// To work around this issue, this script is a manual step that wraps CSS in a
|
|
// JavaScript file that has the compiled CSS embedded in it, and exports only
|
|
// a function that returns the CSS as a string.
|
|
const fs = require("fs")
|
|
const path = require("path")
|
|
|
|
const pathToCss = path.join(__dirname, "../css/index.css")
|
|
const css = fs.readFileSync(pathToCss, "utf8")
|
|
const cssWithEscapedQuotes = css.replace(/"/gm, '\\"')
|
|
|
|
const js = `module.exports = function() { return "${cssWithEscapedQuotes}" }`
|
|
const pathToCssJs = path.join(__dirname, "../css/index.js")
|
|
fs.writeFileSync(pathToCssJs, js)
|