mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
chore: fix type for vue/server
This commit is contained in:
parent
8936fe77eb
commit
1aa47b5edf
@ -1,6 +1,12 @@
|
|||||||
|
|
||||||
|
import { Compilation } from 'webpack'
|
||||||
import { validate, isJS, extractQueryPartJS } from './util'
|
import { validate, isJS, extractQueryPartJS } from './util'
|
||||||
|
|
||||||
export default class VueSSRServerPlugin {
|
export default class VueSSRServerPlugin {
|
||||||
|
options: {
|
||||||
|
filename?: string
|
||||||
|
}
|
||||||
|
|
||||||
constructor (options = {}) {
|
constructor (options = {}) {
|
||||||
this.options = Object.assign({
|
this.options = Object.assign({
|
||||||
filename: null
|
filename: null
|
||||||
@ -10,7 +16,10 @@ export default class VueSSRServerPlugin {
|
|||||||
apply (compiler) {
|
apply (compiler) {
|
||||||
validate(compiler)
|
validate(compiler)
|
||||||
compiler.hooks.make.tap('VueSSRServerPlugin', (compilation: any) => {
|
compiler.hooks.make.tap('VueSSRServerPlugin', (compilation: any) => {
|
||||||
compilation.hooks.processAssets.tapAsync('VueSSRServerPlugin', (assets, cb) => {
|
compilation.hooks.processAssets.tapAsync({
|
||||||
|
name: 'VueSSRServerPlugin',
|
||||||
|
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
||||||
|
}, (assets, cb) => {
|
||||||
const stats = compilation.getStats().toJson()
|
const stats = compilation.getStats().toJson()
|
||||||
const [entryName] = Object.keys(stats.entrypoints)
|
const [entryName] = Object.keys(stats.entrypoints)
|
||||||
const entryInfo = stats.entrypoints[entryName]
|
const entryInfo = stats.entrypoints[entryName]
|
||||||
@ -67,6 +76,6 @@ export default class VueSSRServerPlugin {
|
|||||||
|
|
||||||
cb()
|
cb()
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user