Commit ee97b824 authored by Allen Bai's avatar Allen Bai

feat: 完成模块部分

parent 5a56c677
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div style="height:100vh;background-color:brown"></div>
</body>
</html>
/** @format */ /** @format */
import IPCHelper from '../../../dist/IPCHelper.module' import IPCHelper from '../../../dist/IPCHelper.module'
IPCHelper.mountIPCFooter() IPCHelper.mountIPCFooter({})
/** @format */ /** @format */
const path = require('path') const path = require('path')
const HTMLWebpackPlugin = require('html-webpack-plugin')
module.exports = { module.exports = {
mode: 'development', mode: 'development',
entry: './src/index.js', entry: path.resolve(__dirname, './src/index.js'),
output: { output: {
filename: 'main.[contenthash].js', filename: 'main.[contenthash].js',
path: './dist/' path: path.resolve(__dirname, './dist/')
},
devServer: {
hot: true
}, },
module: { module: {
rules: [] rules: []
} },
plugins: [
new HTMLWebpackPlugin({
template: path.resolve(__dirname, './index.html'),
filename: path.resolve(__dirname, './dist/index.html')
})
]
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"build:debug": "npm run clean && cross-env NODE_ENV=dev rollup -c", "build:debug": "npm run clean && cross-env NODE_ENV=dev rollup -c",
"clean": "rm -rf ./dist", "clean": "rm -rf ./dist",
"test:in_html": "npm run watch & concurrently \"http-server -a localhost -p 1234\" \"open http://localhost:1234/example/inHTML/index.html\"", "test:in_html": "npm run watch & concurrently \"http-server -a localhost -p 1234\" \"open http://localhost:1234/example/inHTML/index.html\"",
"test:in_module": "webpack -s" "test:in_module": "webpack serve --config ./example/inModule/webpack.config.js"
}, },
"typescript": ">=4.0", "typescript": ">=4.0",
"files": [ "files": [
......
...@@ -43,7 +43,7 @@ const defaultBoardStyles: Optional<CSSStyleDeclaration> = { ...@@ -43,7 +43,7 @@ const defaultBoardStyles: Optional<CSSStyleDeclaration> = {
fontSize: '12px' fontSize: '12px'
} }
async function mountIPCFooter(opts: IPCFooterOptions) { async function mountIPCFooter(opts: IPCFooterOptions = {}) {
const icpNumber = await getIPCByDomain(opts.domain || location.host) const icpNumber = await getIPCByDomain(opts.domain || location.host)
const IPCFooter = document.createElement('div') const IPCFooter = document.createElement('div')
const IPCBoard = document.createElement('a') const IPCBoard = document.createElement('a')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment