Skip to content

Commit 99f58ad

Browse files
committed
Builds, but no working CSS yet
1 parent 32597d9 commit 99f58ad

14 files changed

+2589
-196
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"devDependencies": {
2020
"@fullhuman/postcss-purgecss": "^4.0.3",
21+
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.34",
2122
"@tsconfig/svelte": "^2.0.1",
2223
"@types/chrome": "^0.0.149",
2324
"@typescript-eslint/eslint-plugin": "4",
@@ -50,6 +51,8 @@
5051
"tailwindcss": "^2.2.7",
5152
"ts-loader": "^9.2.4",
5253
"typescript": "^4.3.5",
54+
"vite": "^2.7.10",
55+
"vite-plugin-web-extension": "^1.0.3",
5356
"webpack": "^5.47.0",
5457
"webpack-cli": "^4.7.2",
5558
"webpack-ext-reloader": "^1.1.8"

postcss.config.js

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
const extractor = require('smelte/src/utils/css-extractor.js');
2-
const tailwindConfig = require('./tailwind.config.js');
1+
// const extractor = require('smelte/src/utils/css-extractor.js');
2+
// const tailwindConfig = require('./tailwind.config.js');
33

4-
const safelistSelectors = [
5-
'html',
6-
'body',
7-
'stroke-primary',
8-
'mode-dark',
9-
// Components with custom color prop might need its color to be whitelisted too
10-
'bg-blue-500',
11-
'hover:bg-blue-400'
12-
];
4+
// const safelistSelectors = [
5+
// 'html',
6+
// 'body',
7+
// 'stroke-primary',
8+
// 'mode-dark',
9+
// // Components with custom color prop might need its color to be whitelisted too
10+
// 'bg-blue-500',
11+
// 'hover:bg-blue-400'
12+
// ];
1313

14-
const safelistPatterns = [
15-
// for JS ripple
16-
/ripple/,
17-
// date picker
18-
/w-.\/7/,
19-
// I'm guessing it doesn't correlate p-2.5 with p-2\.5
20-
/^[mphw]\w?-\d\.5$/
21-
];
14+
// const safelistPatterns = [
15+
// // for JS ripple
16+
// /ripple/,
17+
// // date picker
18+
// /w-.\/7/,
19+
// // I'm guessing it doesn't correlate p-2.5 with p-2\.5
20+
// /^[mphw]\w?-\d\.5$/
21+
// ];
2222

23-
module.exports = (minify = false) => {
24-
const postcss = [];
25-
return [
26-
require('postcss-import')(),
27-
require('postcss-url')(),
28-
require('postcss-input-range')(),
29-
require('autoprefixer')(),
30-
require('tailwindcss')(tailwindConfig),
31-
...postcss,
32-
minify && require('cssnano')({
33-
preset: 'default'
34-
}),
35-
// Always tree shake CSS even in development mode for ~99% size reduction
36-
require('@fullhuman/postcss-purgecss')({
37-
content: ['./**/*.svelte'],
38-
extractors: [
39-
{
40-
extractor,
41-
extensions: ['svelte']
42-
}
43-
],
44-
safelist: {
45-
standard: safelistSelectors,
46-
deep: safelistPatterns
47-
}
48-
})
49-
].filter(Boolean);
50-
};
23+
// module.exports = (minify = false) => {
24+
// const postcss = [];
25+
// return [
26+
// require('postcss-import')(),
27+
// require('postcss-url')(),
28+
// require('postcss-input-range')(),
29+
// require('autoprefixer')(),
30+
// require('tailwindcss')(tailwindConfig),
31+
// ...postcss,
32+
// minify && require('cssnano')({
33+
// preset: 'default'
34+
// }),
35+
// // Always tree shake CSS even in development mode for ~99% size reduction
36+
// require('@fullhuman/postcss-purgecss')({
37+
// content: ['./**/*.svelte'],
38+
// extractors: [
39+
// {
40+
// extractor,
41+
// extensions: ['svelte']
42+
// }
43+
// ],
44+
// safelist: {
45+
// standard: safelistSelectors,
46+
// deep: safelistPatterns
47+
// }
48+
// })
49+
// ].filter(Boolean);
50+
// };
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.updates = [
1+
export const updates = [
22
{
33
version: 'v1.0.x',
44
comments: 'First release of HyperChat!'

src/hyperchat.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons&display=swap" rel="stylesheet">
7+
<script defer="defer" type="module" src="/hyperchat.ts"></script>
8+
</head>
9+
10+
<body>
11+
</body>
12+
13+
</html>

src/hyperchat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Hyperchat from './components/Hyperchat.svelte';
2-
import 'smelte/src/tailwind.css';
2+
// TODO: CSS
3+
// import 'smelte/src/tailwind.css';
34

45
const hyperchat = new Hyperchat({
56
target: document.body

src/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"https://www.youtube.com/live_chat_replay*"
1818
],
1919
"js": [
20-
"chat-interceptor.bundle.js",
21-
"chat-injector.bundle.js"
20+
"ts/chat-interceptor.ts",
21+
"ts/chat-injector.ts"
2222
],
2323
"all_frames": true
2424
}
2525
],
2626
"background": {
27-
"scripts": ["chat-background.bundle.js"],
27+
"scripts": ["ts/chat-background.ts"],
2828
"persistent": true
2929
},
3030
"browser_action": {

svelte.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
const sveltePreprocess = require('svelte-preprocess');
2-
const postcssPlugins = require('./postcss.config.js');
32

43
module.exports = {
5-
preprocess: sveltePreprocess({
6-
transformers: {
7-
postcss: {
8-
plugins: postcssPlugins()
9-
}
10-
}
11-
})
4+
preprocess: sveltePreprocess()
125
};

0 commit comments

Comments
 (0)