Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
13138449
Jumping Panda
Commits
d6165ad8
Commit
d6165ad8
authored
Oct 30, 2020
by
13138449
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete paths.js
parent
5a2a3c5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
55 deletions
+0
-55
paths.js
paths.js
+0
-55
No files found.
paths.js
deleted
100644 → 0
View file @
5a2a3c5a
'
use strict
'
;
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
);
const
url
=
require
(
'
url
'
);
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
const
appDirectory
=
fs
.
realpathSync
(
process
.
cwd
());
const
resolveApp
=
relativePath
=>
path
.
resolve
(
appDirectory
,
relativePath
);
const
envPublicUrl
=
process
.
env
.
PUBLIC_URL
;
function
ensureSlash
(
path
,
needsSlash
)
{
const
hasSlash
=
path
.
endsWith
(
'
/
'
);
if
(
hasSlash
&&
!
needsSlash
)
{
return
path
.
substr
(
path
,
path
.
length
-
1
);
}
else
if
(
!
hasSlash
&&
needsSlash
)
{
return
`
${
path
}
/`
;
}
else
{
return
path
;
}
}
const
getPublicUrl
=
appPackageJson
=>
envPublicUrl
||
require
(
appPackageJson
).
homepage
;
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
// Webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
// We can't use a relative path in HTML because we don't want to load something
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
function
getServedPath
(
appPackageJson
)
{
const
publicUrl
=
getPublicUrl
(
appPackageJson
);
const
servedUrl
=
envPublicUrl
||
(
publicUrl
?
url
.
parse
(
publicUrl
).
pathname
:
'
/
'
);
return
ensureSlash
(
servedUrl
,
true
);
}
// config after eject: we're in ./config/
module
.
exports
=
{
dotenv
:
resolveApp
(
'
.env
'
),
appBuild
:
resolveApp
(
'
build
'
),
appPublic
:
resolveApp
(
'
public
'
),
appHtml
:
resolveApp
(
'
public/index.html
'
),
appIndexJs
:
resolveApp
(
'
src/index.js
'
),
appPackageJson
:
resolveApp
(
'
package.json
'
),
appSrc
:
resolveApp
(
'
src
'
),
yarnLockFile
:
resolveApp
(
'
yarn.lock
'
),
testsSetup
:
resolveApp
(
'
src/setupTests.js
'
),
appNodeModules
:
resolveApp
(
'
node_modules
'
),
publicUrl
:
getPublicUrl
(
resolveApp
(
'
package.json
'
)),
servedPath
:
getServedPath
(
resolveApp
(
'
package.json
'
)),
};
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