Skip to content

Commit 47c07c3

Browse files
committed
高速化した...のか?
1 parent e00dc7c commit 47c07c3

File tree

3 files changed

+9
-87
lines changed

3 files changed

+9
-87
lines changed

compiler/core/compile/mod.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export type CompileState = {
4848
state: 'ZIPING'
4949
} | {
5050
state: 'COMPILED'
51+
} | {
52+
state: 'READY'
5153
}
5254

5355
export const compile = (chromeExtension: Extension, opts: CompilerInit): CompileResult => {
@@ -74,7 +76,7 @@ export const compile = (chromeExtension: Extension, opts: CompilerInit): Compile
7476
}
7577
}
7678
const stateStream = new StateStream()
77-
;(async () => {
79+
const run = async () => {
7880
const crxData = chromeExtension.getCrxData()
7981
nextStateFunc({
8082
state: 'CRX_TO_ZIP'
@@ -129,7 +131,6 @@ export const compile = (chromeExtension: Extension, opts: CompilerInit): Compile
129131
for (const plugin of plugins) {
130132
await plugin.onCompile(compileInit)
131133
}
132-
133134
fileTree['manifest.json'] = new TextEncoder().encode(JSON.stringify(manifestJson, null, 2))
134135
nextStateFunc({
135136
state: 'ZIPING'
@@ -140,8 +141,11 @@ export const compile = (chromeExtension: Extension, opts: CompilerInit): Compile
140141
nextStateFunc({
141142
state: 'COMPILED'
142143
})
143-
})()
144-
144+
}
145+
nextStateFunc({
146+
state: 'READY'
147+
})
148+
run()
145149
return {
146150
compiled,
147151
stateStream: stateStream

compiler/core/compile/transformer.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

scripts/dev-compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for await (const state of compileProcess.stateStream) {
4242
console.timeEnd('state')
4343

4444
const xpiData = await compileProcess.compiled
45-
45+
console.log(xpiData)
4646
await Deno.writeFile(join('tmp', Deno.args[0] + '.xpi'), xpiData)
4747
await emptyDir(join('tmp', Deno.args[0]))
4848
for (const [path, data] of Object.entries(unzipSync(xpiData))) {

0 commit comments

Comments
 (0)