Added web setup entry point

This commit is contained in:
Ildar Kamalov 2019-01-18 19:29:51 +03:00 committed by Eugene Bujak
parent f21aebd1cf
commit 71259c5f19
4 changed files with 41 additions and 15 deletions

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="shortcut icon" href="https://adguard.com/img/favicons/favicon.ico">
<title>Setup AdGuard Home</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>

View File

@ -8,7 +8,9 @@ const CleanWebpackPlugin = require('clean-webpack-plugin');
const RESOURCES_PATH = path.resolve(__dirname); const RESOURCES_PATH = path.resolve(__dirname);
const ENTRY_REACT = path.resolve(RESOURCES_PATH, 'src/index.js'); const ENTRY_REACT = path.resolve(RESOURCES_PATH, 'src/index.js');
const ENTRY_INSTALL = path.resolve(RESOURCES_PATH, 'src/install/index.js');
const HTML_PATH = path.resolve(RESOURCES_PATH, 'public/index.html'); const HTML_PATH = path.resolve(RESOURCES_PATH, 'public/index.html');
const HTML_INSTALL_PATH = path.resolve(RESOURCES_PATH, 'public/install.html');
const PUBLIC_PATH = path.resolve(__dirname, '../build/static'); const PUBLIC_PATH = path.resolve(__dirname, '../build/static');
@ -16,7 +18,8 @@ const config = {
target: 'web', target: 'web',
context: RESOURCES_PATH, context: RESOURCES_PATH,
entry: { entry: {
bundle: ENTRY_REACT, main: ENTRY_REACT,
install: ENTRY_INSTALL,
}, },
output: { output: {
path: PUBLIC_PATH, path: PUBLIC_PATH,
@ -101,8 +104,16 @@ const config = {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: true, inject: true,
cache: false, cache: false,
chunks: ['main'],
template: HTML_PATH, template: HTML_PATH,
}), }),
new HtmlWebpackPlugin({
inject: true,
cache: false,
chunks: ['install'],
filename: 'install.html',
template: HTML_INSTALL_PATH,
}),
new ExtractTextPlugin({ new ExtractTextPlugin({
filename: '[name].[contenthash].css', filename: '[name].[contenthash].css',
}), }),

View File

@ -2,7 +2,6 @@ const merge = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
module.exports = merge(common, { module.exports = merge(common, {
devtool: 'inline-source-map',
module: { module: {
rules: [{ rules: [{
test: /\.js$/, test: /\.js$/,