Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mirador-video-annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Loïs Poujade
mirador-video-annotations
Commits
951c4063
Commit
951c4063
authored
4 years ago
by
Chris Beer
Browse files
Options
Downloads
Patches
Plain Diff
Remove configs/paths.js
parent
0c64d783
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/paths.js
+0
-98
0 additions, 98 deletions
config/paths.js
webpack.config.js
+2
-2
2 additions, 2 deletions
webpack.config.js
with
2 additions
and
100 deletions
config/paths.js
deleted
100644 → 0
+
0
−
98
View file @
0c64d783
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/facebook/create-react-app/issues/637
const
appDirectory
=
fs
.
realpathSync
(
process
.
cwd
());
/**
*
* @param relativePath
* @returns {string}
*/
const
resolveApp
=
relativePath
=>
path
.
resolve
(
appDirectory
,
relativePath
);
const
envPublicUrl
=
process
.
env
.
PUBLIC_URL
;
/**
*
* @param inputPath
* @param needsSlash
* @returns {*}
*/
function
ensureSlash
(
inputPath
,
needsSlash
)
{
const
hasSlash
=
inputPath
.
endsWith
(
'
/
'
);
if
(
hasSlash
&&
!
needsSlash
)
{
return
inputPath
.
substr
(
0
,
inputPath
.
length
-
1
);
}
else
if
(
!
hasSlash
&&
needsSlash
)
{
return
`
${
inputPath
}
/`
;
}
else
{
return
inputPath
;
}
}
/**
*
* @param appPackageJson
* @returns {string | *}
*/
const
getPublicUrl
=
appPackageJson
=>
envPublicUrl
||
require
(
appPackageJson
).
homepage
;
/**
*
* @param appPackageJson
* @returns {*}
*/
function
getServedPath
(
appPackageJson
)
{
const
publicUrl
=
getPublicUrl
(
appPackageJson
);
const
servedUrl
=
envPublicUrl
||
(
publicUrl
?
url
.
parse
(
publicUrl
).
pathname
:
'
/
'
);
return
ensureSlash
(
servedUrl
,
true
);
}
const
moduleFileExtensions
=
[
'
web.mjs
'
,
'
mjs
'
,
'
web.js
'
,
'
js
'
,
'
web.ts
'
,
'
ts
'
,
'
web.tsx
'
,
'
tsx
'
,
'
json
'
,
'
web.jsx
'
,
'
jsx
'
,
];
/**
*
* @param resolveFn
* @param filePath
* @returns {*}
*/
const
resolveModule
=
(
resolveFn
,
filePath
)
=>
{
const
extension
=
moduleFileExtensions
.
find
(
extension
=>
fs
.
existsSync
(
resolveFn
(
`
${
filePath
}
.
${
extension
}
`
)));
if
(
extension
)
{
return
resolveFn
(
`
${
filePath
}
.
${
extension
}
`
);
}
return
resolveFn
(
`
${
filePath
}
.js`
);
};
module
.
exports
=
{
dotenv
:
resolveApp
(
'
.env
'
),
appPath
:
resolveApp
(
'
.
'
),
appBuild
:
resolveApp
(
'
build
'
),
appDist
:
resolveApp
(
'
dist
'
),
appIndexJs
:
resolveModule
(
resolveApp
,
'
src/index
'
),
appPackageJson
:
resolveApp
(
'
package.json
'
),
appSrc
:
resolveApp
(
'
src
'
),
testsSetup
:
resolveModule
(
resolveApp
,
'
src/setupTests
'
),
appNodeModules
:
resolveApp
(
'
node_modules
'
),
publicUrl
:
getPublicUrl
(
resolveApp
(
'
package.json
'
)),
servedPath
:
getServedPath
(
resolveApp
(
'
package.json
'
)),
};
module
.
exports
.
moduleFileExtensions
=
moduleFileExtensions
;
This diff is collapsed.
Click to expand it.
webpack.config.js
+
2
−
2
View file @
951c4063
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
);
const
webpack
=
require
(
'
webpack
'
);
const
webpack
=
require
(
'
webpack
'
);
const
TerserPlugin
=
require
(
'
terser-webpack-plugin
'
);
const
TerserPlugin
=
require
(
'
terser-webpack-plugin
'
);
const
ReactRefreshWebpackPlugin
=
require
(
'
@pmmmwh/react-refresh-webpack-plugin
'
);
const
ReactRefreshWebpackPlugin
=
require
(
'
@pmmmwh/react-refresh-webpack-plugin
'
);
const
paths
=
require
(
'
./config/paths
'
);
/** */
/** */
const
baseConfig
=
mode
=>
({
const
baseConfig
=
mode
=>
({
...
@@ -10,7 +10,7 @@ const baseConfig = mode => ({
...
@@ -10,7 +10,7 @@ const baseConfig = mode => ({
module
:
{
module
:
{
rules
:
[
rules
:
[
{
{
include
:
path
s
.
appPath
,
// CRL
include
:
path
.
resolve
(
fs
.
realpathSync
(
process
.
cwd
()),
'
.
'
)
,
// CRL
loader
:
require
.
resolve
(
'
babel-loader
'
),
loader
:
require
.
resolve
(
'
babel-loader
'
),
options
:
{
options
:
{
// Save disk space when time isn't as important
// Save disk space when time isn't as important
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment