Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a730b04d
Commit
a730b04d
authored
Aug 16, 2017
by
Arunoda Susiripala
Committed by
GitHub
Aug 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use _ as the divider for dynamic import name splitter. (#2793)
Using - gives us some weird webpack errors.
parent
eafa2c67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
handle-import.js
server/build/babel/plugins/handle-import.js
+3
-3
No files found.
server/build/babel/plugins/handle-import.js
View file @
a730b04d
...
...
@@ -2,7 +2,7 @@
// We've added support for SSR with this version
import
template
from
'babel-template'
import
syntax
from
'babel-plugin-syntax-dynamic-import'
import
{
dirname
,
resolve
}
from
'path'
import
{
dirname
,
resolve
,
sep
}
from
'path'
import
Crypto
from
'crypto'
const
TYPE_IMPORT
=
'Import'
...
...
@@ -62,8 +62,8 @@ export default () => ({
const
modulePath
=
getModulePath
(
sourceFilename
,
moduleName
)
const
modulePathHash
=
Crypto
.
createHash
(
'md5'
).
update
(
modulePath
).
digest
(
'hex'
)
const
relativeModulePath
=
modulePath
.
replace
(
process
.
cwd
()
,
''
)
const
name
=
`
${
relativeModulePath
.
replace
(
/
[^\w]
/g
,
'
-'
)}
-
${
modulePathHash
}
`
const
relativeModulePath
=
modulePath
.
replace
(
`
${
process
.
cwd
()}${
sep
}
`
,
''
)
const
name
=
`
${
relativeModulePath
.
replace
(
/
[^\w]
/g
,
'
_'
)}
_
${
modulePathHash
}
`
const
newImport
=
buildImport
({
name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment