FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
plugin-css/css-plugin-base.js at master · systemjs/plugin-css · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
systemjs
/
plugin-css
Public archive
Notifications
You must be signed in to change notification settings
Fork
56
Star
92
Code
Issues
14
Pull requests
2
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
plugin-css
/
css-plugin-base.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
70 lines (59 loc) · 1.86 KB
Breadcrumbs
plugin-css
/
css-plugin-base.js
Copy path
File metadata and controls
70 lines (59 loc) · 1.86 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Base CSS Plugin Class
*/
function
CSSPluginBase
(
compileCSS
)
{
this
.
compileCSS
=
compileCSS
;
this
.
translate
=
function
(
load
,
opts
)
{
var
loader
=
this
;
if
(
loader
.
builder
&&
loader
.
buildCSS
===
false
)
{
load
.
metadata
.
build
=
false
;
return
;
}
var
path
=
this
.
_nodeRequire
&&
this
.
_nodeRequire
(
'path'
)
;
return
Promise
.
resolve
(
compileCSS
.
call
(
loader
,
load
.
source
,
load
.
address
,
load
.
metadata
.
loaderOptions
||
{
}
)
)
.
then
(
function
(
result
)
{
load
.
metadata
.
style
=
result
.
css
;
load
.
metadata
.
styleSourceMap
=
result
.
map
;
if
(
result
.
moduleFormat
)
load
.
metadata
.
format
=
result
.
moduleFormat
;
return
result
.
moduleSource
||
''
;
}
)
;
}
;
}
var
isWin
=
typeof
process
!=
'undefined'
&&
process
.
platform
.
match
(
/
^
w
i
n
/
)
;
function
toFileURL
(
path
)
{
return
'file://'
+
(
isWin
?
'/'
:
''
)
+
path
.
replace
(
/
\\
/
g
,
'/'
)
;
}
var
builderPromise
;
function
getBuilder
(
loader
)
{
if
(
builderPromise
)
return
builderPromise
;
return
builderPromise
=
loader
[
'import'
]
(
'./css-plugin-base-builder.js'
,
module
.
id
)
;
}
CSSPluginBase
.
prototype
.
bundle
=
function
(
loads
,
compileOpts
,
outputOpts
)
{
var
loader
=
this
;
return
getBuilder
(
loader
)
.
then
(
function
(
builder
)
{
return
builder
.
bundle
.
call
(
loader
,
loads
,
compileOpts
,
outputOpts
)
;
}
)
;
}
;
CSSPluginBase
.
prototype
.
listAssets
=
function
(
loads
,
opts
)
{
var
loader
=
this
;
return
getBuilder
(
loader
)
.
then
(
function
(
builder
)
{
return
builder
.
listAssets
.
call
(
loader
,
loads
,
opts
)
;
}
)
;
}
;
/*
* <style> injection browser plugin
*/
// NB hot reloading support here
CSSPluginBase
.
prototype
.
instantiate
=
function
(
load
)
{
if
(
this
.
builder
||
typeof
document
===
'undefined'
)
return
;
var
style
=
document
.
createElement
(
'style'
)
;
style
.
type
=
'text/css'
;
style
.
innerHTML
=
load
.
metadata
.
style
;
document
.
head
.
appendChild
(
style
)
;
}
;
module
.
exports
=
CSSPluginBase
;
Back
|
FazBrowse Home
|
New Git URL