aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-05-01 16:17:52 +0200
committerTeddy Wing2019-05-01 16:17:52 +0200
commit46ed2319819f5037444a4c8a4098d3558717928e (patch)
tree81e00db3c4d1829d0c1be2ed8d1f6eac18a064d6
parent5060215546fdd4019bce1335d92150736cc18975 (diff)
downloadmuttagen-46ed2319819f5037444a4c8a4098d3558717928e.tar.bz2
Use CommonJS modules, fix imports
* Use single quotes * Add 'sidebar.ts' to main * Fix `SIDEBAR` import from 'gmail_css_class.ts' * Remove ".ts" extensions from imports * Build to 'build/' directory instead of a file. This creates one JS file per module by the Typescript compiler.
-rw-r--r--src/index.ts3
-rw-r--r--src/sidebar.ts2
-rw-r--r--src/style.ts2
-rw-r--r--tsconfig.json4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/index.ts b/src/index.ts
index e5c3103..538d0c4 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -5,4 +5,5 @@
// @match https://mail.google.com/*
// ==/UserScript==
-import "./style.ts";
+import './style';
+import './sidebar';
diff --git a/src/sidebar.ts b/src/sidebar.ts
index 6e20980..4e106e1 100644
--- a/src/sidebar.ts
+++ b/src/sidebar.ts
@@ -1 +1 @@
-import SIDEBAR from './gmail_css_class.ts';
+import { SIDEBAR } from './gmail_css_class';
diff --git a/src/style.ts b/src/style.ts
index 4ed8fd3..1ef58b0 100644
--- a/src/style.ts
+++ b/src/style.ts
@@ -1,4 +1,4 @@
-import * as g from './gmail_css_class.ts';
+import * as g from './gmail_css_class';
type GmailCSSDefinitions = { [selector in g.GmailCSSClass]: string };
diff --git a/tsconfig.json b/tsconfig.json
index 637f7ff..d216efa 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,8 +1,8 @@
{
"compilerOptions": {
- "module": "amd",
+ "module": "commonjs",
"target": "ES5",
- "outFile": "./build/muttagen.user.js",
+ "outDir": "./build",
"sourceMap": true
},
"include": [