mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-04 21:17:55 +08:00
improve bundle renderer file path detection
This commit is contained in:
parent
3681016338
commit
1d22896587
@ -37,7 +37,11 @@ export function createBundleRendererCreator (createRenderer: () => Renderer) {
|
||||
let basedir = rendererOptions && rendererOptions.basedir
|
||||
|
||||
// load bundle if given filepath
|
||||
if (typeof bundle === 'string' && bundle.charAt(0) === '/') {
|
||||
if (
|
||||
typeof bundle === 'string' &&
|
||||
/\.js(on)?$/.test(bundle) &&
|
||||
path.isAbsolute(bundle)
|
||||
) {
|
||||
if (fs.existsSync(bundle)) {
|
||||
basedir = basedir || path.dirname(bundle)
|
||||
bundle = fs.readFileSync(bundle, 'utf-8')
|
||||
|
Loading…
Reference in New Issue
Block a user