FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
webpack/lib/FunctionModuleTemplatePlugin.js at master · codeinvain/webpack · GitHub
codeinvain
webpack
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
webpack
/
lib
/
FunctionModuleTemplatePlugin.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (46 loc) · 1.88 KB
Breadcrumbs
webpack
/
lib
/
FunctionModuleTemplatePlugin.js
Copy path
File metadata and controls
48 lines (46 loc) · 1.88 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
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var
ConcatSource
=
require
(
"webpack-sources"
)
.
ConcatSource
;
var
PrefixSource
=
require
(
"webpack-sources"
)
.
PrefixSource
;
function
FunctionModuleTemplatePlugin
(
)
{
}
module
.
exports
=
FunctionModuleTemplatePlugin
;
FunctionModuleTemplatePlugin
.
prototype
.
apply
=
function
(
moduleTemplate
)
{
moduleTemplate
.
plugin
(
"render"
,
function
(
moduleSource
,
module
)
{
var
source
=
new
ConcatSource
(
)
;
var
defaultArguments
=
[
"module"
,
"exports"
]
;
if
(
(
module
.
arguments
&&
module
.
arguments
.
length
!==
0
)
||
module
.
hasDependencies
(
)
)
{
defaultArguments
.
push
(
"__webpack_require__"
)
;
}
source
.
add
(
"/***/ function("
+
defaultArguments
.
concat
(
module
.
arguments
||
[
]
)
.
join
(
", "
)
+
") {\n\n"
)
;
if
(
module
.
strict
)
source
.
add
(
"\"use strict\";\n"
)
;
source
.
add
(
moduleSource
)
;
source
.
add
(
"\n\n/***/ }"
)
;
return
source
;
}
)
;
moduleTemplate
.
plugin
(
"package"
,
function
(
moduleSource
,
module
)
{
if
(
this
.
outputOptions
.
pathinfo
)
{
var
source
=
new
ConcatSource
(
)
;
var
req
=
module
.
readableIdentifier
(
this
.
requestShortener
)
;
if
(
Array
.
isArray
(
module
.
providedExports
)
)
source
.
add
(
"/* exports provided: "
+
module
.
providedExports
.
join
(
", "
)
+
" */\n"
)
;
else
if
(
module
.
providedExports
)
source
.
add
(
"/* unknown exports provided */\n"
)
;
if
(
Array
.
isArray
(
module
.
usedExports
)
)
source
.
add
(
"/* exports used: "
+
module
.
usedExports
.
join
(
", "
)
+
" */\n"
)
;
else
if
(
module
.
usedExports
)
source
.
add
(
"/* all exports used */\n"
)
;
source
.
add
(
"/*!****"
+
req
.
replace
(
/
.
/
g
,
"*"
)
+
"****!*\\\n"
)
;
source
.
add
(
" !*** "
+
req
.
replace
(
/
\*
\/
/
g
,
"*_/"
)
+
" ***!\n"
)
;
source
.
add
(
" \\****"
+
req
.
replace
(
/
.
/
g
,
"*"
)
+
"****/\n"
)
;
source
.
add
(
moduleSource
)
;
return
source
;
}
return
moduleSource
;
}
)
;
moduleTemplate
.
plugin
(
"hash"
,
function
(
hash
)
{
hash
.
update
(
"FunctionModuleTemplatePlugin"
)
;
hash
.
update
(
"2"
)
;
}
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL