Skip to content

Commit a730b04

Browse files
authored
Use _ as the divider for dynamic import name splitter. (vercel#2793)
Using - gives us some weird webpack errors.
1 parent eafa2c6 commit a730b04

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/build/babel/plugins/handle-import.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// We've added support for SSR with this version
33
import template from 'babel-template'
44
import syntax from 'babel-plugin-syntax-dynamic-import'
5-
import { dirname, resolve } from 'path'
5+
import { dirname, resolve, sep } from 'path'
66
import Crypto from 'crypto'
77

88
const TYPE_IMPORT = 'Import'
@@ -62,8 +62,8 @@ export default () => ({
6262
const modulePath = getModulePath(sourceFilename, moduleName)
6363
const modulePathHash = Crypto.createHash('md5').update(modulePath).digest('hex')
6464

65-
const relativeModulePath = modulePath.replace(process.cwd(), '')
66-
const name = `${relativeModulePath.replace(/[^\w]/g, '-')}-${modulePathHash}`
65+
const relativeModulePath = modulePath.replace(`${process.cwd()}${sep}`, '')
66+
const name = `${relativeModulePath.replace(/[^\w]/g, '_')}_${modulePathHash}`
6767

6868
const newImport = buildImport({
6969
name

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy