Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
ba845f52
Unverified
Commit
ba845f52
authored
6 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Clean up
parent
5105981e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webpack.config.ts
+1
-24
1 addition, 24 deletions
webpack.config.ts
webpack/loaders/replace.js
+0
-30
0 additions, 30 deletions
webpack/loaders/replace.js
with
1 addition
and
54 deletions
webpack.config.ts
+
1
−
24
View file @
ba845f52
...
...
@@ -6,7 +6,6 @@ import * as fs from 'fs';
import
*
as
webpack
from
'
webpack
'
;
import
chalk
from
'
chalk
'
;
const
{
VueLoaderPlugin
}
=
require
(
'
vue-loader
'
);
const
minifyHtml
=
require
(
'
html-minifier
'
).
minify
;
const
WebpackOnBuildPlugin
=
require
(
'
on-build-webpack
'
);
//const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const
ProgressBarPlugin
=
require
(
'
progress-bar-webpack-plugin
'
);
...
...
@@ -18,20 +17,6 @@ const meta = require('./package.json');
const
version
=
meta
.
clientVersion
;
const
codename
=
meta
.
codename
;
declare
var
global
:
{
collapseSpacesReplacement
:
any
;
};
//#region Replacer definitions
global
[
'
collapseSpacesReplacement
'
]
=
(
html
:
string
)
=>
{
return
minifyHtml
(
html
,
{
collapseWhitespace
:
true
,
collapseInlineTagWhitespace
:
true
,
keepClosingSlash
:
true
}).
replace
(
/
\t
/g
,
''
);
};
//#endregion
const
langs
=
Object
.
keys
(
locales
);
const
isProduction
=
process
.
env
.
NODE_ENV
==
'
production
'
;
...
...
@@ -122,14 +107,6 @@ module.exports = {
}
},
{
loader
:
'
vue-svg-inline-loader
'
},
{
loader
:
'
replace
'
,
query
:
{
qs
:
[{
search
:
/^<template>
([\s\S]
+
?)\r?\n
<
\/
template>/
.
toString
(),
replace
:
'
collapseSpacesReplacement
'
}]
}
}]
},
{
test
:
/
\.
styl
(
us
)?
$/
,
...
...
@@ -199,7 +176,7 @@ module.exports = {
}
},
resolveLoader
:
{
modules
:
[
'
node_modules
'
,
'
./webpack/loaders
'
]
modules
:
[
'
node_modules
'
]
},
cache
:
true
,
devtool
:
false
,
//'source-map',
...
...
This diff is collapsed.
Click to expand it.
webpack/loaders/replace.js
deleted
100644 → 0
+
0
−
30
View file @
5105981e
import
{
getOptions
}
from
'
loader-utils
'
;
function
trim
(
text
,
g
)
{
return
text
.
substring
(
1
,
text
.
length
-
(
g
?
2
:
0
));
}
export
default
function
(
src
)
{
const
fn
=
options
=>
{
const
search
=
options
.
search
;
const
g
=
search
.
endsWith
(
'
g
'
);
const
file
=
this
.
resourcePath
.
replace
(
/
\\
/g
,
'
/
'
);
const
replace
=
options
.
i18n
?
global
[
options
.
replace
].
bind
(
null
,
{
src
:
file
,
lang
:
options
.
lang
})
:
global
[
options
.
replace
];
if
(
typeof
search
!=
'
string
'
||
search
.
length
==
0
)
console
.
error
(
'
invalid search
'
);
if
(
typeof
replace
!=
'
function
'
)
console
.
error
(
'
invalid replacer:
'
,
replace
,
this
.
request
);
src
=
src
.
replace
(
new
RegExp
(
trim
(
search
,
g
),
g
?
'
g
'
:
''
),
replace
);
};
this
.
cacheable
();
const
options
=
getOptions
(
this
);
if
(
options
.
qs
)
{
options
.
qs
.
forEach
(
q
=>
fn
(
q
));
}
else
{
fn
(
options
);
}
this
.
callback
(
null
,
src
);
return
src
;
}
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