Skip to content
Permalink
Browse files
Avoid variable from empty module name be empty (#3026)
* Create main.js

* Create _config.js

* Update _config.js

* Update _config.js

* Delete main.js

* Update identifierHelpers.ts
  • Loading branch information
LongTengDao authored and lukastaegert committed Aug 5, 2019
1 parent 17eaa43 commit 456f4d2c3603976f69f1e753377f9b1649a99b5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
@@ -24,5 +24,5 @@ export function makeLegal(str: string): string {

if (startsWithDigit(str) || blacklisted[str]) str = `_${str}`;

return str;
return str || '_';
}
@@ -0,0 +1,19 @@
module.exports = {
description: 'avoid variable from empty module name be empty',
options: {
input: '',
plugins: [
{
resolveId (importee) {
return '';
},
load (path) {
return 'export default 0;';
},
}
],
output: {
format: 'cjs'
}
}
};

0 comments on commit 456f4d2

Please sign in to comment.