workflow(sfc-playground): copy server-renderer browser build
This commit is contained in:
parent
ec2856c2ba
commit
b50353a183
@ -21,21 +21,24 @@ function copyVuePlugin(): Plugin {
|
|||||||
return {
|
return {
|
||||||
name: 'copy-vue',
|
name: 'copy-vue',
|
||||||
generateBundle() {
|
generateBundle() {
|
||||||
const filePath = path.resolve(
|
const copyFile = (file: string) => {
|
||||||
__dirname,
|
const filePath = path.resolve(__dirname, file)
|
||||||
'../vue/dist/vue.runtime.esm-browser.js'
|
const basename = path.basename(file)
|
||||||
)
|
if (!fs.existsSync(filePath)) {
|
||||||
if (!fs.existsSync(filePath)) {
|
throw new Error(
|
||||||
throw new Error(
|
`${basename} not built. ` +
|
||||||
`vue.runtime.esm-browser.js not built. ` +
|
`Run "nr build vue -f esm-browser" first.`
|
||||||
`Run "nr build vue -f esm-browser" first.`
|
)
|
||||||
)
|
}
|
||||||
|
this.emitFile({
|
||||||
|
type: 'asset',
|
||||||
|
fileName: basename,
|
||||||
|
source: fs.readFileSync(filePath, 'utf-8')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.emitFile({
|
|
||||||
type: 'asset',
|
copyFile(`../vue/dist/vue.runtime.esm-browser.js`)
|
||||||
fileName: 'vue.runtime.esm-browser.js',
|
copyFile(`../server-renderer/dist/server-renderer.esm-browser.js`)
|
||||||
source: fs.readFileSync(filePath, 'utf-8')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user