Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9723555

Browse files
committed
Clean up
1 parent 10b3da7 commit 9723555

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

plugins/css.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { extname, join } from 'https://deno.land/[email protected]/path/mod.ts'
22
import { esbuild } from '../bundler/esbuild.ts'
33
import { toLocalPath, computeHash } from '../server/helper.ts'
44
import { existsFile } from '../shared/fs.ts'
5-
import util from '../shared/util.ts'
65
import { Measure } from '../shared/log.ts'
6+
import util from '../shared/util.ts'
77
import type { ModuleLoader, Plugin, PostCSSPlugin } from '../types.ts'
88

99
const postcssVersion = '8.3.5'
1010
const postcssModulesVersion = '4.1.3'
1111
const productionOnlyPostcssPlugins = ['autoprefixer']
1212
const isModulesPluginName = (v: any): v is string => (typeof v === 'string' && /^postcss\-modules(@|$)/i.test(v.trim()))
1313

14+
/** the builtin css loader */
1415
export const builtinCSSLoader: Readonly<ModuleLoader> = {
1516
test: /\.(css|pcss|postcss)$/i,
1617
acceptHMR: true,
@@ -139,19 +140,11 @@ export const builtinCSSLoader: Readonly<ModuleLoader> = {
139140
}
140141
}
141142

142-
/** checks whether the loader is builtin css loader */
143+
/** check whether the loader is the builtin css loader */
143144
export function isBuiltinCSSLoader(loader: ModuleLoader): boolean {
144145
return loader === builtinCSSLoader
145146
}
146147

147-
148-
export default (): Plugin => {
149-
return {
150-
name: 'css-loader',
151-
setup: (aleph) => aleph.addModuleLoader(builtinCSSLoader)
152-
}
153-
}
154-
155148
async function initPostCSS(plugins: PostCSSPlugin[], isDev: boolean) {
156149
const pluginObjects = await Promise.all(plugins.filter(p => {
157150
if (isDev) {
@@ -195,3 +188,10 @@ async function importPostcssPluginByName(name: string) {
195188
const { default: Plugin } = await import(url)
196189
return Plugin
197190
}
191+
192+
export default (): Plugin => {
193+
return {
194+
name: 'css-loader',
195+
setup: (aleph) => aleph.addModuleLoader(builtinCSSLoader)
196+
}
197+
}

plugins/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ export const markdownLoader: Readonly<ModuleLoader> = {
5252
export default (): Plugin => {
5353
return {
5454
name: 'markdown-loader',
55-
setup: (aleph) => aleph.addModuleLoader(markdownLoader)
55+
setup: aleph => aleph.addModuleLoader(markdownLoader)
5656
}
5757
}

0 commit comments

Comments
 (0)