Skip to content

Commit d05e60c

Browse files
committed
publish fix undefind
1 parent 64e90d9 commit d05e60c

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

lib/react-hot.dev.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-hot.dev.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-react-hot-transformer",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"descripton": "react hot transformer for ts,and no babel",
55
"main": "index.js",
66
"typings": "index.d.ts",

src/react-hot.dev.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ export default function transformer(context: ts.TransformationContext) {
133133
const identifiers = (sourceFile as any).identifiers as Map<string, any>;
134134
let ID = `_default`;
135135
let idx = 1;
136-
while (identifiers.has(ID)) {
137-
ID = `_default${++idx}`;
136+
if (typeof identifiers !== 'undefined') {
137+
while (identifiers.has(ID)) {
138+
ID = `_default${++idx}`;
139+
}
138140
}
139141
const REGISTRATIONS = [];
140142
const visitor: ts.Visitor = node => {

test/react-hot.components.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function addRHLPlugin(prod = false) {
1212
describe('React components', () => {
1313
readdirSync(FIXTURES_DIR).forEach(fixtureName => {
1414
const fixtureFile = join(FIXTURES_DIR, fixtureName);
15-
// const testFile: Array<string> = ['bindings.js'];
15+
// const testFile: Array<string> = ['test.js'];
1616
// if (statSync(fixtureFile).isFile() && testFile.indexOf(fixtureName) > -1) {
1717
if (statSync(fixtureFile).isFile()) {
1818
it(fixtureName.split('-').join(' '), () => {

0 commit comments

Comments
 (0)