Revert "Convert site to ESM (#6772)"

This reverts commit e45d180162.
pull/6796/head
Conduitry 3 years ago
parent 0d4ad364be
commit ada0767ff2

4358
site/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -2,7 +2,6 @@
"name": "svelte.dev",
"version": "1.0.0",
"description": "Docs and examples for Svelte",
"type": "module",
"scripts": {
"dev": "node scripts/update.js && npm run copy-workers && sapper dev",
"copy-workers": "node scripts/copy-workers.js",
@ -23,7 +22,7 @@
"httpie": "^1.1.2",
"jsonwebtoken": "^8.5.1",
"marked": "^1.0.0",
"pg": "^8.7.1",
"pg": "^7.12.1",
"polka": "^1.0.0-next.9",
"prism-svelte": "^0.4.3",
"prismjs": "^1.25.0",
@ -45,7 +44,7 @@
"@sveltejs/site-kit": "^1.4.0",
"@sveltejs/svelte-repl": "^0.2.1",
"degit": "^2.1.4",
"dotenv": "^10.0.0",
"dotenv": "^8.1.0",
"esm": "^3.2.25",
"jimp": "^0.8.0",
"mocha": "^6.2.0",

@ -20,9 +20,6 @@ if (!dev && !process.env.MAPBOX_ACCESS_TOKEN) {
const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning);
const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/');
const serverOutput = config.server.output();
serverOutput.format = 'esm';
export default {
client: {
input: config.client.input(),
@ -74,7 +71,7 @@ export default {
server: {
input: config.server.input(),
output: serverOutput,
output: config.server.output(),
plugins: [
replace({
'process.browser': false,

@ -1,4 +1,4 @@
import sh from 'shelljs';
const sh = require('shelljs');
sh.rm('-rf', 'static/workers');
sh.cp('-r', 'node_modules/@sveltejs/svelte-repl/workers', 'static');

@ -1,7 +1,7 @@
import fs from 'fs';
import puppeteer from 'puppeteer';
import Jimp from 'jimp';
import c from 'kleur';
const fs = require('fs');
const puppeteer = require('puppeteer');
const Jimp = require('jimp');
const c = require('kleur');
const slugs = [];

@ -1,8 +1,5 @@
import sander from 'sander';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const sander = require('sander');
const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(`${__dirname}/../..`);
function extract_frontmatter(markdown) {

@ -1,14 +1,10 @@
import 'dotenv/config';
import fs from 'fs';
import fetch from 'node-fetch';
import Jimp from 'jimp';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
require('dotenv/config');
const fs = require('fs');
const fetch = require('node-fetch');
const Jimp = require('jimp');
const force = process.env.FORCE_UPDATE === 'true';
const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(__dirname);
const outputFile = `../src/routes/_contributors.js`;

@ -1,4 +1,4 @@
import sh from 'shelljs';
const sh = require('shelljs');
sh.env['FORCE_UPDATE'] = process.argv.includes('--force=true');

@ -1,11 +1,9 @@
import sh from 'shelljs';
import fs from 'fs';
import path, { dirname } from 'path';
import { fileURLToPath } from 'url';
const sh = require('shelljs');
const fs = require('fs');
const path = require('path');
const force = process.env.FORCE_UPDATE === 'true';
const __dirname = dirname(fileURLToPath(import.meta.url));
sh.cd(path.join(__dirname, '..'));
const outputFile = 'static/svelte-app.json';

@ -1,7 +1,7 @@
import pg from 'pg';
import { Pool } from 'pg';
// Uses `PG*` ENV vars
export const DB = process.env.PGHOST ? new pg.Pool() : null;
export const DB = process.env.PGHOST ? new Pool() : null;
export function query(text, values=[]) {
return DB.query(text, values).then(r => r.rows);

Loading…
Cancel
Save