Skip to content

Commit

Permalink
For scope hoisting, Asset IDs cannot contain + or / (base64) (parcel-…
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored and garthenweb committed Feb 25, 2019
1 parent 7f28931 commit 644abc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/parcel-bundler/src/assets/VueAsset.js
Expand Up @@ -2,6 +2,7 @@ const Asset = require('../Asset');
const localRequire = require('../utils/localRequire');
const md5 = require('../utils/md5');
const {minify} = require('terser');
const t = require('@babel/types');

class VueAsset extends Asset {
constructor(name, options) {
Expand Down Expand Up @@ -72,10 +73,10 @@ class VueAsset extends Asset {

// TODO: make it possible to process this code with the normal scope hoister
if (this.options.scopeHoist) {
optsVar = `$${this.id}$export$default`;
optsVar = `$${t.toIdentifier(this.id)}$export$default`;

if (!js.includes(optsVar)) {
optsVar = `$${this.id}$exports`;
optsVar = `$${t.toIdentifier(this.id)}$exports`;
if (!js.includes(optsVar)) {
supplemental += `
var ${optsVar} = {};
Expand Down

0 comments on commit 644abc7

Please sign in to comment.