Match-id-6cde1d60850e4a64e0d4c16b2dad41f9f29fc8a5
This commit is contained in:
parent
cc4a8d2a1d
commit
0ae3910553
|
@ -7,7 +7,7 @@
|
||||||
"build": "webpack --config ./webpack.config.js",
|
"build": "webpack --config ./webpack.config.js",
|
||||||
"watch": "webpack --config ./webpack.config.js --watch",
|
"watch": "webpack --config ./webpack.config.js --watch",
|
||||||
"build-dev": "webpack --config ./webpack.dev.js",
|
"build-dev": "webpack --config ./webpack.dev.js",
|
||||||
"start": "webpack serve --config ./webpack.dev.js ",
|
"start": "npm run build && webpack serve --config ./webpack.dev.js ",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html style="display: flex">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf8">
|
<meta charset="utf8">
|
||||||
<title>Horizon</title>
|
|
||||||
<script src='horizon.production.js'></script>
|
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -24,11 +22,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<script src='horizon.development.js'></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
<div id="root"></div>
|
<script src="panel.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,5 +1,21 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
function handleBuildDir() {
|
||||||
|
const staticDir = path.join(__dirname, 'build');
|
||||||
|
console.log('staticDir: ', staticDir);
|
||||||
|
const isBuildExist = fs.existsSync(staticDir);
|
||||||
|
console.log('isBuildExist: ', isBuildExist);
|
||||||
|
if (!isBuildExist) {
|
||||||
|
fs.mkdirSync(staticDir);
|
||||||
|
}
|
||||||
|
fs.copyFileSync(path.join(__dirname, 'src', 'panel', 'panel.html'),path.join(staticDir, 'panel.html'));
|
||||||
|
fs.copyFileSync(path.join(__dirname, 'src', 'main', 'main.html'),path.join(staticDir, 'main.html'));
|
||||||
|
fs.copyFileSync(path.join(__dirname, 'src', 'manifest.json'),path.join(staticDir, 'manifest.json'));
|
||||||
|
}
|
||||||
|
handleBuildDir();
|
||||||
|
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
entry: {
|
entry: {
|
||||||
|
|
|
@ -47,7 +47,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
static: {
|
static: {
|
||||||
directory: path.join(__dirname, 'dist'),
|
directory: path.join(__dirname, 'build'),
|
||||||
},
|
},
|
||||||
open: 'panel.html',
|
open: 'panel.html',
|
||||||
port: 9000,
|
port: 9000,
|
||||||
|
|
Loading…
Reference in New Issue