add prettier
This commit is contained in:
parent
868b46317d
commit
63478aa887
22
api/package-lock.json
generated
22
api/package-lock.json
generated
@ -21,6 +21,7 @@
|
|||||||
"@types/express-session": "^1.17.5",
|
"@types/express-session": "^1.17.5",
|
||||||
"@types/ip": "^1.1.0",
|
"@types/ip": "^1.1.0",
|
||||||
"@types/node": "^18.7.18",
|
"@types/node": "^18.7.18",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"typescript": "^4.0.0"
|
"typescript": "^4.0.0"
|
||||||
@ -1124,6 +1125,21 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin-prettier.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/proxy-addr": {
|
"node_modules/proxy-addr": {
|
||||||
"version": "2.0.7",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
@ -2508,6 +2524,12 @@
|
|||||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"proxy-addr": {
|
"proxy-addr": {
|
||||||
"version": "2.0.7",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"dev": "ts-node-dev --respawn --transpile-only ./src/app.ts",
|
"dev": "ts-node-dev --respawn --transpile-only ./src/app.ts",
|
||||||
"start": "npm run build && node ./dist/app.js"
|
"start": "npm run build && node ./dist/app.js",
|
||||||
|
"prettier": "prettier -w ./src"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/cors": "^2.8.12",
|
"@types/cors": "^2.8.12",
|
||||||
@ -15,6 +16,7 @@
|
|||||||
"@types/express-session": "^1.17.5",
|
"@types/express-session": "^1.17.5",
|
||||||
"@types/ip": "^1.1.0",
|
"@types/ip": "^1.1.0",
|
||||||
"@types/node": "^18.7.18",
|
"@types/node": "^18.7.18",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"typescript": "^4.0.0"
|
"typescript": "^4.0.0"
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
import Server, { Services } from './framework/express/server';
|
import Server, { Services } from './framework/express/server';
|
||||||
import Mongo from './framework/mongo/mongo';
|
import Mongo from './framework/mongo/mongo';
|
||||||
import ip from "ip";
|
import ip from 'ip';
|
||||||
|
|
||||||
const PORT = 8000;
|
const PORT = 8000;
|
||||||
const MONGOURI = "mongodb://localhost:27017";
|
const MONGOURI = 'mongodb://localhost:27017';
|
||||||
|
|
||||||
const mongo = new Mongo(MONGOURI);
|
const mongo = new Mongo(MONGOURI);
|
||||||
|
|
||||||
const services: Services = {
|
const services: Services = {
|
||||||
db: mongo.getDb()
|
db: mongo.getDb(),
|
||||||
}
|
};
|
||||||
|
|
||||||
const server = new Server(services);
|
const server = new Server(services);
|
||||||
|
|
||||||
server.start(PORT, () => console.log(`Running on http://${ip.address()}:${PORT}`));
|
server.start(PORT, () =>
|
||||||
|
console.log(`Running on http://${ip.address()}:${PORT}`),
|
||||||
|
);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from 'express';
|
||||||
import { randomUUID } from "crypto";
|
import { randomUUID } from 'crypto';
|
||||||
|
|
||||||
export function BeforeEach(): RequestHandler {
|
export function BeforeEach(): RequestHandler {
|
||||||
return (req, res, next) => {
|
return (req, res, next) => {
|
||||||
req.headers["request-id"] = randomUUID();
|
req.headers['request-id'] = randomUUID();
|
||||||
next();
|
next();
|
||||||
}
|
};
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
import { Router } from "express";
|
import { Router } from 'express';
|
||||||
import { Services } from "./server";
|
import { Services } from './server';
|
||||||
import * as user from "./user";
|
import * as user from './user';
|
||||||
|
|
||||||
export function getRoutes(services: Services) {
|
export function getRoutes(services: Services) {
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.use("/user", user.getRoutes(services));
|
router.use('/user', user.getRoutes(services));
|
||||||
|
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import express, { Express } from "express";
|
import express, { Express } from 'express';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import * as router from './router';
|
import * as router from './router';
|
||||||
import { BeforeEach } from "./middleware";
|
import { BeforeEach } from './middleware';
|
||||||
import { Db } from "mongodb";
|
import { Db } from 'mongodb';
|
||||||
|
|
||||||
export type Services = {
|
export type Services = {
|
||||||
db: Db;
|
db: Db;
|
||||||
}
|
};
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
private app: Express;
|
private app: Express;
|
||||||
|
@ -12,10 +12,10 @@ export function CreateHandler(services: Services): RequestHandler {
|
|||||||
const createUser = Create(services);
|
const createUser = Create(services);
|
||||||
|
|
||||||
return async (req, res) => {
|
return async (req, res) => {
|
||||||
const user = await createUser(req.get("request-id"), req.body);
|
const user = await createUser(req.get('request-id'), req.body);
|
||||||
|
|
||||||
res.send(user);
|
res.send(user);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getRoutes(services: Services) {
|
export function getRoutes(services: Services) {
|
||||||
@ -26,5 +26,3 @@ export function getRoutes(services: Services) {
|
|||||||
|
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MongoClient, Db } from "mongodb";
|
import { MongoClient, Db } from 'mongodb';
|
||||||
|
|
||||||
class Mongo {
|
class Mongo {
|
||||||
private client: MongoClient;
|
private client: MongoClient;
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
import { CreateUserBody, User, UserInfo } from "@core";
|
import { CreateUserBody, User, UserInfo } from '@core';
|
||||||
import { Services } from "../express/server";
|
import { Services } from '../express/server';
|
||||||
|
|
||||||
export function Create(services: Services): (tracker: string, user: CreateUserBody) => Promise<UserInfo> {
|
export function Create(
|
||||||
|
services: Services,
|
||||||
|
): (tracker: string, user: CreateUserBody) => Promise<UserInfo> {
|
||||||
const { db } = services;
|
const { db } = services;
|
||||||
const coll = db.collection("users");
|
const coll = db.collection('users');
|
||||||
|
|
||||||
return async (tracker, user) => {
|
return async (tracker, user) => {
|
||||||
await coll.insertOne(user);
|
await coll.insertOne(user);
|
||||||
return {
|
return {
|
||||||
name: "test"
|
name: 'test',
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
}
|
}
|
@ -1,11 +1,13 @@
|
|||||||
import { CreateUserBody, UserInfo } from "@core";
|
import { CreateUserBody, UserInfo } from '@core';
|
||||||
import { Services } from "../framework/express/server";
|
import { Services } from '../framework/express/server';
|
||||||
import * as mongo from "../framework/mongo/user";
|
import * as mongo from '../framework/mongo/user';
|
||||||
|
|
||||||
export function Create(services: Services): (tracker: string, user: CreateUserBody) => Promise<UserInfo> {
|
export function Create(
|
||||||
|
services: Services,
|
||||||
|
): (tracker: string, user: CreateUserBody) => Promise<UserInfo> {
|
||||||
const createUser = mongo.Create(services);
|
const createUser = mongo.Create(services);
|
||||||
|
|
||||||
return async (tracker, user) => {
|
return async (tracker, user) => {
|
||||||
return createUser(tracker, user);
|
return createUser(tracker, user);
|
||||||
}
|
};
|
||||||
}
|
}
|
@ -7,21 +7,12 @@
|
|||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@core": [
|
"@core": ["../core/src"]
|
||||||
"../core/src"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lib": [
|
"lib": ["es2015"],
|
||||||
"es2015"
|
"include": ["src/**/*"],
|
||||||
],
|
"exclude": ["node_modules/*", "dist/*"],
|
||||||
"include": [
|
|
||||||
"src/**/*"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/*",
|
|
||||||
"dist/*"
|
|
||||||
],
|
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "../core"
|
"path": "../core"
|
||||||
|
22
core/package-lock.json
generated
22
core/package-lock.json
generated
@ -8,9 +8,25 @@
|
|||||||
"name": "core",
|
"name": "core",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.8.3"
|
"typescript": "^4.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin-prettier.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.8.3",
|
"version": "4.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
|
||||||
@ -26,6 +42,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.8.3",
|
"version": "4.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
|
||||||
|
@ -5,9 +5,11 @@
|
|||||||
"author": "Yanis Rigaudeau - Axel Barault",
|
"author": "Yanis Rigaudeau - Axel Barault",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc"
|
"build": "tsc",
|
||||||
|
"prettier": "prettier -w ./src"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.8.3"
|
"typescript": "^4.8.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,2 +1,2 @@
|
|||||||
export * from './user';
|
export * from "./user";
|
||||||
export * from './entity';
|
export * from "./entity";
|
||||||
|
@ -2,7 +2,7 @@ import { Entity } from "./entity";
|
|||||||
|
|
||||||
export type UserInfo = {
|
export type UserInfo = {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
};
|
||||||
|
|
||||||
export type User = UserInfo & Entity;
|
export type User = UserInfo & Entity;
|
||||||
|
|
||||||
|
@ -6,12 +6,7 @@
|
|||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"outDir": "dist"
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*"],
|
||||||
"src/**/*"
|
"exclude": ["node_modules/*", "dist/*"],
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/*",
|
|
||||||
"dist/*"
|
|
||||||
],
|
|
||||||
"references": []
|
"references": []
|
||||||
}
|
}
|
22
www/package-lock.json
generated
22
www/package-lock.json
generated
@ -18,6 +18,7 @@
|
|||||||
"@rollup/plugin-typescript": "^8.0.0",
|
"@rollup/plugin-typescript": "^8.0.0",
|
||||||
"@tsconfig/svelte": "^2.0.0",
|
"@tsconfig/svelte": "^2.0.0",
|
||||||
"@types/three": "^0.144.0",
|
"@types/three": "^0.144.0",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"rollup": "^2.3.4",
|
"rollup": "^2.3.4",
|
||||||
"rollup-plugin-css-only": "^3.1.0",
|
"rollup-plugin-css-only": "^3.1.0",
|
||||||
"rollup-plugin-livereload": "^2.0.0",
|
"rollup-plugin-livereload": "^2.0.0",
|
||||||
@ -1011,6 +1012,21 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin-prettier.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/queue-microtask": {
|
"node_modules/queue-microtask": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||||
@ -2359,6 +2375,12 @@
|
|||||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"prettier": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"queue-microtask": {
|
"queue-microtask": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"dev": "rollup -c -w ",
|
"dev": "rollup -c -w ",
|
||||||
"start": "sirv public --no-clear --host",
|
"start": "sirv public --no-clear --host",
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"prettier": "prettier -w ./src"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^17.0.0",
|
"@rollup/plugin-commonjs": "^17.0.0",
|
||||||
@ -16,6 +17,7 @@
|
|||||||
"@rollup/plugin-typescript": "^8.0.0",
|
"@rollup/plugin-typescript": "^8.0.0",
|
||||||
"@tsconfig/svelte": "^2.0.0",
|
"@tsconfig/svelte": "^2.0.0",
|
||||||
"@types/three": "^0.144.0",
|
"@types/three": "^0.144.0",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"rollup": "^2.3.4",
|
"rollup": "^2.3.4",
|
||||||
"rollup-plugin-css-only": "^3.1.0",
|
"rollup-plugin-css-only": "^3.1.0",
|
||||||
"rollup-plugin-livereload": "^2.0.0",
|
"rollup-plugin-livereload": "^2.0.0",
|
||||||
|
@ -19,14 +19,18 @@ function serve() {
|
|||||||
return {
|
return {
|
||||||
writeBundle() {
|
writeBundle() {
|
||||||
if (server) return;
|
if (server) return;
|
||||||
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
|
server = require('child_process').spawn(
|
||||||
|
'npm',
|
||||||
|
['run', 'start', '--', '--dev'],
|
||||||
|
{
|
||||||
stdio: ['ignore', 'inherit', 'inherit'],
|
stdio: ['ignore', 'inherit', 'inherit'],
|
||||||
shell: true
|
shell: true,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
process.on('SIGTERM', toExit);
|
process.on('SIGTERM', toExit);
|
||||||
process.on('exit', toExit);
|
process.on('exit', toExit);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,15 +40,15 @@ export default {
|
|||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
name: 'app',
|
name: 'app',
|
||||||
file: 'public/build/bundle.js'
|
file: 'public/build/bundle.js',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
svelte({
|
svelte({
|
||||||
preprocess: sveltePreprocess({ sourceMap: !production }),
|
preprocess: sveltePreprocess({ sourceMap: !production }),
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
// enable run-time checks when not in production
|
// enable run-time checks when not in production
|
||||||
dev: !production
|
dev: !production,
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
// we'll extract any component CSS out into
|
// we'll extract any component CSS out into
|
||||||
// a separate file - better for performance
|
// a separate file - better for performance
|
||||||
@ -58,12 +62,12 @@ export default {
|
|||||||
resolve({
|
resolve({
|
||||||
main: true,
|
main: true,
|
||||||
browser: true,
|
browser: true,
|
||||||
dedupe: ['svelte']
|
dedupe: ['svelte'],
|
||||||
}),
|
}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
typescript({
|
typescript({
|
||||||
sourceMap: !production,
|
sourceMap: !production,
|
||||||
inlineSources: !production
|
inlineSources: !production,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// In dev mode, call `npm run start` once
|
// In dev mode, call `npm run start` once
|
||||||
@ -76,9 +80,9 @@ export default {
|
|||||||
|
|
||||||
// If we're building for production (npm run build
|
// If we're building for production (npm run build
|
||||||
// instead of npm run dev), minify
|
// instead of npm run dev), minify
|
||||||
production && terser()
|
production && terser(),
|
||||||
],
|
],
|
||||||
watch: {
|
watch: {
|
||||||
clearScreen: false
|
clearScreen: false,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ import App from './App.svelte';
|
|||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
props: {}
|
props: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
@ -3,18 +3,11 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@core": [
|
"@core": ["../core/src"]
|
||||||
"../core/src"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*"],
|
||||||
"src/**/*"
|
"exclude": ["node_modules/*", "public/*"],
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/*",
|
|
||||||
"public/*"
|
|
||||||
],
|
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "../core"
|
"path": "../core"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user