|
@@ -43,9 +43,10 @@ export function createBundleRendererCreator (createRenderer: () => Renderer) {
|
|
|
path.isAbsolute(bundle)
|
|
path.isAbsolute(bundle)
|
|
|
) {
|
|
) {
|
|
|
if (fs.existsSync(bundle)) {
|
|
if (fs.existsSync(bundle)) {
|
|
|
|
|
+ const isJSON = /\.json$/.test(bundle)
|
|
|
basedir = basedir || path.dirname(bundle)
|
|
basedir = basedir || path.dirname(bundle)
|
|
|
bundle = fs.readFileSync(bundle, 'utf-8')
|
|
bundle = fs.readFileSync(bundle, 'utf-8')
|
|
|
- if (/\.json$/.test(bundle)) {
|
|
|
|
|
|
|
+ if (isJSON) {
|
|
|
try {
|
|
try {
|
|
|
bundle = JSON.parse(bundle)
|
|
bundle = JSON.parse(bundle)
|
|
|
} catch (e) {
|
|
} catch (e) {
|