Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
elixire
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
Container Registry
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ave
elixire
Commits
4220e052
Commit
4220e052
authored
7 years ago
by
Heatingdevice
Browse files
Options
Downloads
Patches
Plain Diff
webpack v4 support
parent
e665d380
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
frontend/package.json
+11
-9
11 additions, 9 deletions
frontend/package.json
frontend/src/token.js
+15
-8
15 additions, 8 deletions
frontend/src/token.js
frontend/webpack.config.js
+5
-6
5 additions, 6 deletions
frontend/webpack.config.js
frontend/yarn.lock
+2697
-912
2697 additions, 912 deletions
frontend/yarn.lock
with
2728 additions
and
935 deletions
frontend/package.json
+
11
−
9
View file @
4220e052
...
...
@@ -6,14 +6,14 @@
"author"
:
"Ave Ozkal <avezone@ave.zone>"
,
"license"
:
"MIT"
,
"scripts"
:
{
"start"
:
"webpack-dev-server --port 8081 --compress --watch --cache --open"
,
"build:production"
:
"NODE_ENV=production webpack"
,
"build:dev"
:
"NODE_ENV=dev webpack"
"start"
:
"webpack-dev-server --port 8081 --compress --watch --cache --open
--mode development
"
,
"build:production"
:
"NODE_ENV=production webpack
--mode production
"
,
"build:dev"
:
"NODE_ENV=dev webpack
--mode development
"
},
"private"
:
true
,
"dependencies"
:
{
"bootstrap"
:
"4"
,
"clipboard"
:
"^
1.7.1
"
,
"clipboard"
:
"^
2.0.0
"
,
"file-size"
:
"^1.0.0"
,
"highlightjs"
:
"^9.10.0"
,
"jquery"
:
"^3.3.1"
,
...
...
@@ -22,6 +22,7 @@
},
"devDependencies"
:
{
"@babel/core"
:
"^7.0.0-beta.39"
,
"@babel/plugin-syntax-dynamic-import"
:
"^7.0.0-beta.40"
,
"@babel/preset-env"
:
"^7.0.0-beta.39"
,
"babel-loader"
:
"8.0.0-beta.0"
,
"babel-minify-webpack-plugin"
:
"^0.3.0"
,
...
...
@@ -30,16 +31,17 @@
"clean-webpack-plugin"
:
"^0.1.18"
,
"css-loader"
:
"^0.28.9"
,
"eslint"
:
"^4.17.0"
,
"extract-text-webpack-plugin"
:
"^
3
.0.
2
"
,
"extract-text-webpack-plugin"
:
"^
4
.0.
0-beta.0
"
,
"file-loader"
:
"^1.1.6"
,
"html-webpack-plugin"
:
"^
2.
30.
1
"
,
"html-webpack-plugin"
:
"^3
.
0.
6
"
,
"html-webpack-template-pug"
:
"^1.1.1"
,
"node-sass"
:
"^4.7.2"
,
"pug"
:
"^2.0.0-rc.4"
,
"pug-loader"
:
"
^2.3.0
"
,
"pug-loader"
:
"
https://github.com/pugjs/pug-loader/tarball/master
"
,
"sass-loader"
:
"^6.0.6"
,
"style-loader"
:
"^0.20.1"
,
"webpack"
:
"^3.10.0"
,
"webpack-dev-server"
:
"^2.9.7"
"webpack"
:
"4"
,
"webpack-cli"
:
"^2.0.11"
,
"webpack-dev-server"
:
"^3.1.1"
}
}
This diff is collapsed.
Click to expand it.
frontend/src/token.js
+
15
−
8
View file @
4220e052
import
"
./token.scss
"
;
import
uploaders
from
"
./uploaders.js
"
;
import
"
highlightjs/styles/solarized-light.css
"
;
window
.
addEventListener
(
"
load
"
,
async
function
()
{
const
token
=
window
.
location
.
hash
.
substring
(
1
);
document
.
getElementById
(
"
token
"
).
innerText
=
token
;
const
kshareConfig
=
uploaders
.
kshareConfig
(
token
);
const
sharexConfig
=
uploaders
.
sharexConfig
(
token
);
const
elixireManager
=
uploaders
.
elixireManager
(
token
);
document
.
getElementById
(
"
kshare-config
"
).
innerText
=
kshareConfig
;
document
.
getElementById
(
"
sharex-config
"
).
innerText
=
sharexConfig
;
highlight
.
highlightBlock
(
document
.
getElementById
(
"
sharex-config
"
));
highlight
.
highlightBlock
(
document
.
getElementById
(
"
kshare-config
"
));
const
kshareDl
=
document
.
getElementById
(
"
kshare-dl
"
);
kshareDl
.
href
=
URL
.
createObjectURL
(
...
...
@@ -23,9 +21,18 @@ window.addEventListener("load", async function() {
new
Blob
([
sharexConfig
],
{
type
:
"
application/json
"
})
);
sharexDl
.
download
=
"
elixire.sxcu
"
;
const
elixireManagerDl
=
document
.
getElementById
(
"
elixire-manager-dl
"
);
elixireManagerDl
.
href
=
URL
.
createObjectURL
(
new
Blob
([
elixireManager
],
{
type
:
"
application/json
"
})
);
elixireManagerDl
.
download
=
"
elixiremanager.sh
"
;
// This way we can still await the highlight deps
window
.
profilePromise
.
then
(()
=>
{
const
elixireManager
=
uploaders
.
elixireManager
(
token
);
const
elixireManagerDl
=
document
.
getElementById
(
"
elixire-manager-dl
"
);
elixireManagerDl
.
href
=
URL
.
createObjectURL
(
new
Blob
([
elixireManager
],
{
type
:
"
application/json
"
})
);
elixireManagerDl
.
download
=
"
elixiremanager.sh
"
;
});
const
highlight
=
await
import
(
"
highlightjs/highlight.pack.js
"
);
highlight
.
highlightBlock
(
document
.
getElementById
(
"
sharex-config
"
));
highlight
.
highlightBlock
(
document
.
getElementById
(
"
kshare-config
"
));
console
.
log
(
"
highlighted!
"
);
});
This diff is collapsed.
Click to expand it.
frontend/webpack.config.js
+
5
−
6
View file @
4220e052
...
...
@@ -32,8 +32,7 @@ const pageList = [
},
{
title
:
"
New Token | Elixire
"
,
chunkName
:
"
token
"
,
chunks
:
[
"
highlight
"
,
"
highlightTheme
"
]
chunkName
:
"
token
"
},
{
title
:
"
About Us | Elixire
"
,
...
...
@@ -63,8 +62,6 @@ module.exports = {
account
:
`
${
SRC_DIR
}
/account.js`
,
logout
:
`
${
SRC_DIR
}
/logout.js`
,
token
:
`
${
SRC_DIR
}
/token.js`
,
highlight
:
`
${
SRC_DIR
}
/highlight.js`
,
highlightTheme
:
`
${
SRC_DIR
}
/highlightTheme.js`
,
theme
:
`
${
SRC_DIR
}
/theme.js`
,
bootstrapJs
:
"
bootstrap
"
,
themeCSS
:
`
${
SRC_DIR
}
/themeCSS.js`
,
...
...
@@ -130,7 +127,8 @@ module.exports = {
loader
:
"
babel-loader
"
,
options
:
{
babelrc
:
false
,
presets
:
[
"
@babel/preset-env
"
]
presets
:
[
"
@babel/preset-env
"
],
plugins
:
[
"
@babel/plugin-syntax-dynamic-import
"
]
}
},
{
...
...
@@ -145,7 +143,8 @@ module.exports = {
},
{
test
:
/
\.
pug$/
,
use
:
[
"
pug-loader
"
],
loader
:
"
pug-loader
"
,
query
:
{},
exclude
:
/node_modules/
},
{
...
...
This diff is collapsed.
Click to expand it.
frontend/yarn.lock
+
2697
−
912
View file @
4220e052
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
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