* pack web_src/js/draw.js to public/js/index.js * fix eslinttags/v1.11.0-rc1
/* globals gitGraph */ | |||||
$(document).ready(function () { | |||||
const graphList = []; | |||||
if (!document.getElementById('graph-canvas')) { | |||||
return; | |||||
} | |||||
$("#graph-raw-list li span.node-relation").each(function () { | |||||
graphList.push($(this).text()); | |||||
}) | |||||
gitGraph(document.getElementById('graph-canvas'), graphList); | |||||
}) |
<tr> | <tr> | ||||
<td><a href="../js/index.js">index.js</a></td> | <td><a href="../js/index.js">index.js</a></td> | ||||
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td> | <td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td> | ||||
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">index.js</a></td> | |||||
</tr> | |||||
<tr> | |||||
<td><a href="../js/draw.js">draw.js</a></td> | |||||
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td> | |||||
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">draw.js</a></td> | |||||
<td><a href="https://github.com/go-gitea/gitea/tree/master/web_src/js">*.js</a></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="./plugins/clipboard/clipboard.min.js">clipboard.min.js</a></td> | <td><a href="./plugins/clipboard/clipboard.min.js">clipboard.min.js</a></td> |
{{if .RequireGitGraph}} | {{if .RequireGitGraph}} | ||||
<!-- graph --> | <!-- graph --> | ||||
<script src="{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js"></script> | <script src="{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js"></script> | ||||
<script src="{{StaticUrlPrefix}}/js/draw.js"></script> | |||||
{{end}} | {{end}} | ||||
<!-- Third-party libraries --> | <!-- Third-party libraries --> |
'{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js', | '{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js', | ||||
'{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}', | '{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}', | ||||
'{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}', | '{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}', | ||||
'{{StaticUrlPrefix}}/js/draw.js', | |||||
'{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js', | '{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js', | ||||
'{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js', | '{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js', | ||||
'{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js', | '{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js', |
/* globals gitGraph */ | |||||
$(() => { | |||||
const graphList = []; | |||||
if (!document.getElementById('graph-canvas')) { | |||||
return; | |||||
} | |||||
$('#graph-raw-list li span.node-relation').each(function () { | |||||
graphList.push($(this).text()); | |||||
}); | |||||
gitGraph(document.getElementById('graph-canvas'), graphList); | |||||
}); |
module.exports = { | module.exports = { | ||||
mode: 'production', | mode: 'production', | ||||
entry: { | entry: { | ||||
index: './web_src/js/index.js', | |||||
index: ['./web_src/js/index', './web_src/js/draw'] | |||||
}, | }, | ||||
devtool: 'source-map', | devtool: 'source-map', | ||||
output: { | output: { | ||||
path: path.resolve(__dirname, 'public/js'), | path: path.resolve(__dirname, 'public/js'), | ||||
filename: '[name].js' | |||||
filename: 'index.js' | |||||
}, | }, | ||||
optimization: { | optimization: { | ||||
minimize: true, | minimize: true, |