Skip to content

Commit cebf2ba

Browse files
committed
Optimized app imports
1 parent 2f42065 commit cebf2ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2058
-1949
lines changed

pwa.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { InjectManifest } = require("workbox-webpack-plugin");
2+
const stylusLoader = require("stylus-loader");
23
const { join } = require("path");
34

45
exports.webpack = function(config, env) {
@@ -15,6 +16,18 @@ exports.webpack = function(config, env) {
1516
swSrc: join(src, "sw.js"),
1617
})
1718
);
19+
config.module.rules.forEach(({ test, use }) => {
20+
if ((test.test(".styl") || test.test(".stylus")) && Array.isArray(use)) {
21+
use.forEach((loader) => {
22+
if (loader.loader === "stylus-loader") {
23+
loader.options.import = [
24+
join(src, "styles/theme/index.styl"),
25+
join(src, "styles/mixins.styl"),
26+
];
27+
} else loader;
28+
});
29+
}
30+
});
1831
};
1932

2033
exports.brotli = {

src/App.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</template>
1717

1818
<script>
19-
import Terminal from "@components/Terminal";
19+
const Terminal = () => import("@components/Terminal");
2020
2121
export default {
2222
components: {
@@ -83,8 +83,6 @@ export default {
8383
</script>
8484

8585
<style module lang="stylus">
86-
@require '~@styles/theme';
87-
8886
.app {
8987
color: var(--text-color);
9088
background: var(--background-color);

src/components/Countdown.vue

+9-13
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export default {
2727
props: {
2828
until: {
2929
type: Date,
30-
required: true
31-
}
30+
required: true,
31+
},
3232
},
3333
data() {
3434
return {
35-
now: Math.trunc(new Date().getTime() / 1000)
35+
now: Math.trunc(new Date().getTime() / 1000),
3636
};
3737
},
3838
computed: {
@@ -53,7 +53,7 @@ export default {
5353
},
5454
seconds() {
5555
return this.timeDiff % 60;
56-
}
56+
},
5757
},
5858
mounted() {
5959
window.setInterval(() => {
@@ -69,15 +69,12 @@ export default {
6969
return `0${value}`;
7070
}
7171
return value;
72-
}
73-
}
72+
},
73+
},
7474
};
7575
</script>
7676

7777
<style module lang="stylus">
78-
@require '~@styles/theme';
79-
@require '~@styles/mixins';
80-
8178
.countdown {
8279
font-family: 'Roboto Slab';
8380
display: flex;
@@ -91,19 +88,18 @@ export default {
9188
9289
.txt {
9390
text-align: center;
94-
font-size: 21px;
91+
$font-size: 21px;
9592
}
9693
9794
.value {
9895
text-align: center;
99-
font-size: 50px;
96+
$font-size: 50px;
10097
font-weight: 600;
10198
10299
~/.xs ^[1..-1], ~/.sm ^[1..-1] {
103-
font-size: 24px;
100+
$font-size: 24px;
104101
}
105102
}
106103
}
107104
}
108105
</style>
109-

src/components/FloatingButton.vue

+9-12
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,28 @@ export default {
1212
props: {
1313
text: {
1414
required: true,
15-
type: String
15+
type: String,
1616
},
1717
link: {
1818
required: false,
1919
type: String,
20-
default: null
21-
}
20+
default: null,
21+
},
2222
},
2323
computed: {
2424
animateClass() {
2525
return isMinimal(this.$mq) ? "" : this.$style.animate;
26-
}
26+
},
2727
},
2828
methods: {
2929
openLink() {
3030
if (this.link != null) this.$router.push({ name: this.link });
31-
}
32-
}
31+
},
32+
},
3333
};
3434
</script>
3535

36-
<style module lang = "stylus">
37-
@require '~@styles/theme';
38-
@require '~@styles/mixins';
39-
36+
<style module lang="stylus">
4037
$btn-height = 60px;
4138
$btn-width = 60px;
4239
$btn-radius = 30px;
@@ -65,7 +62,7 @@ $image-expand-width = 18px;
6562
.txt {
6663
color: black;
6764
font-family: 'Aldo the Apache';
68-
font-size: 18px;
65+
$font-size: 18px;
6966
margin-left: 5px;
7067
}
7168
@@ -81,4 +78,4 @@ $image-expand-width = 18px;
8178
margin-top: (($btn-height - 18px) / 2);
8279
}
8380
}
84-
</style>
81+
</style>

src/components/Footer.vue

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ export default {};
3535
</script>
3636

3737
<style module lang="stylus">
38-
@require '~@styles/theme';
39-
@require '~@styles/mixins';
40-
4138
.footer {
42-
font-size: 10px;
39+
$font-size: 10px;
4340
font-weight: 800;
4441
background: $mine-shaft;
4542
letter-spacing: 0.5px;

src/components/ForgotPassword.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ export default {
6262
};
6363
</script>
6464
<style module lang="stylus">
65-
@require '~@styles/theme';
6665
@require '~@styles/anims';
6766
6867
.authContainer {
69-
font-size: 16px;
68+
$font-size: 16px;
7069
font-family: courier, monospace;
7170
max-width: 800px;
7271
margin: auto;
@@ -89,7 +88,7 @@ export default {
8988
top: 0;
9089
z-index: 1;
9190
font-family: 'Roboto Mono';
92-
font-size: 18px;
91+
$font-size: 18px;
9392
}
9493
9594
.root {
@@ -114,7 +113,7 @@ export default {
114113
outline: 0;
115114
max-width: 600px;
116115
width: 100%;
117-
font-size: 16px;
116+
$font-size: 16px;
118117
background: #fff2;
119118
border-radius: 5px;
120119
padding-left: 5px;
@@ -146,7 +145,7 @@ export default {
146145
background: transparent;
147146
color: $white;
148147
border-radius: 100%;
149-
font-size: 40px;
148+
$font-size: 40px;
150149
height: 40px;
151150
width: 40px;
152151
justify-content: space-between;

0 commit comments

Comments
 (0)