Skip to content

Commit 8546d4e

Browse files
authored
Merge pull request #57 from stefanv/update-to-es-modules
Update to ES Modules
2 parents 853b51f + a85d3be commit 8546d4e

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

CHARTER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ The website is compiled by running `make`, which executes the following steps:
4646
post (so that each post gets a static URL) (see `gatsby-node.mjs`).
4747

4848
Frontend filtering is done via JavaScript. Filters are defined in
49-
`src/filter-jobs.js` and the accompanying frontend lives in
49+
`src/filter-jobs.mjs` and the accompanying frontend lives in
5050
`src/components/JobsFilter.jsx`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"build": "gatsby build",
99
"develop": "gatsby develop",
10-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
10+
"format": "prettier --write \"**/*.{js,mjs,jsx,ts,tsx,json,md}\"",
1111
"start": "npm run develop",
1212
"serve": "gatsby serve",
1313
"clean": "gatsby clean",

src/components/Job.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import { Link } from "gatsby";
33

44
import Badge from "./Badge";
5-
import jobToMarkdown from "../jobToMarkdown.js";
5+
import jobToMarkdown from "../jobToMarkdown.mjs";
66

77

88
const Job = ({ job }) => {

src/components/JobsFilter.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Jobs from "./Jobs";
66
import HowToPost from "./HowToPost";
77

88
import jobData from '../jobs.mjs';
9-
import filterJobs from '../filter-jobs.js';
9+
import filterJobs from '../filter-jobs.mjs';
1010

1111

1212
const defaultFormValues = {
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { marked } from 'marked';
2+
import DOMPurify from 'dompurify';
23

3-
const DOMPurify = (typeof window !== 'undefined') ? require('dompurify') : undefined;
4-
const sanitize = (DOMPurify && DOMPurify.sanitize) ? DOMPurify.sanitize : (x, y) => x;
4+
const sanitize = (typeof window !== 'undefined' && DOMPurify && DOMPurify.sanitize) ? DOMPurify.sanitize : (x, y) => x;
55

66
export const jobToMarkdown = (job) => {
77
if (!job) return job;

src/pages/job.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Page from '../components/Page';
55
import Job from '../components/Job';
66

77
// pageContext comes from createPage in
8-
// gatsby-node.esm.js
8+
// gatsby-node.mjs
99
const job = ({ pageContext }) => {
1010
const { job } = pageContext;
1111
return (

0 commit comments

Comments
 (0)