Skip to content

Commit 791687f

Browse files
authored
Bring back extensions in server package (#1006)
Brings back extensions removed in 114cea2, which caused issue #1005.
1 parent 3bb6f3d commit 791687f

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"react/sort-comp": "off",
1919
"react/jsx-props-no-spreading": "off",
2020
"react/state-in-constructor": "off",
21+
"import/extensions": "off",
2122
"import/prefer-default-export": "off"
2223
}
2324
}

packages/server/src/ChunkExtractor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable react/no-danger */
22
import path from 'path'
33
import fs from 'fs'
4-
import uniq from 'lodash/uniq'
5-
import uniqBy from 'lodash/uniqBy'
6-
import flatMap from 'lodash/flatMap'
4+
import uniq from 'lodash/uniq.js'
5+
import uniqBy from 'lodash/uniqBy.js'
6+
import flatMap from 'lodash/flatMap.js'
77
import React from 'react'
8-
import { invariant, getRequiredChunkKey } from './sharedInternals'
9-
import ChunkExtractorManager from './ChunkExtractorManager'
10-
import { smartRequire, joinURLPath, readJsonFileSync } from './util'
8+
import { invariant, getRequiredChunkKey } from './sharedInternals.js'
9+
import ChunkExtractorManager from './ChunkExtractorManager.js'
10+
import { smartRequire, joinURLPath, readJsonFileSync } from './util.js'
1111

1212
const EXTENSION_SCRIPT_TYPES = {
1313
'.js': 'script',

packages/server/src/ChunkExtractor.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import 'regenerator-runtime/runtime'
2+
import 'regenerator-runtime/runtime.js'
33
import path from 'path'
44
import stats from '../__fixtures__/stats.json'
5-
import ChunkExtractor from './ChunkExtractor'
5+
import ChunkExtractor from './ChunkExtractor.js'
66

77
const targetPath = path.resolve(
88
__dirname,
@@ -683,7 +683,7 @@ describe('ChunkExtrator', () => {
683683
expect(extractor.inputFileSystem.readFile).toHaveBeenCalledTimes(2)
684684
expect(data).toMatchInlineSnapshot(`
685685
"foo
686-
686+
687687
foo
688688
"
689689
`)

packages/server/src/ChunkExtractorManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Context } from './sharedInternals'
2+
import { Context } from './sharedInternals.js'
33

44
const ChunkExtractorManager = ({ extractor, children }) => (
55
<Context.Provider value={extractor}>{children}</Context.Provider>

packages/server/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { default as ChunkExtractorManager } from './ChunkExtractorManager'
2-
export { default as ChunkExtractor } from './ChunkExtractor'
1+
export { default as ChunkExtractorManager } from './ChunkExtractorManager.js'
2+
export { default as ChunkExtractor } from './ChunkExtractor.js'

packages/server/src/util.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { joinURLPath } from './util'
1+
import { joinURLPath } from './util.js'
22

33
describe('util', () => {
44
describe('#joinURLPath', () => {

0 commit comments

Comments
 (0)