mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-23 06:55:25 +00:00
基于template做代码结构调整
This commit is contained in:
10
CocosCreatorInspector/src/core/page.ejs
Normal file
10
CocosCreatorInspector/src/core/page.ejs
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
17
CocosCreatorInspector/src/core/tools.js
Normal file
17
CocosCreatorInspector/src/core/tools.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const path = require('path')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
htmlPage(title, filename, chunks, template) {
|
||||
return new HtmlWebpackPlugin({
|
||||
title: title,
|
||||
hash: true,
|
||||
cache: true,
|
||||
inject: 'body',
|
||||
filename: './pages/' + filename + '.html',
|
||||
template: template || path.resolve(__dirname, './page.ejs'),
|
||||
appMountId: 'app',
|
||||
chunks: chunks
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user