mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
refactor: move views html around
This commit is contained in:
parent
87e6f427de
commit
f651a826d8
@ -6,6 +6,7 @@
|
|||||||
<title>Options</title>
|
<title>Options</title>
|
||||||
<link rel="stylesheet" href="css/options.css" />
|
<link rel="stylesheet" href="css/options.css" />
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
<body></body>
|
<div id="options-root"></div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -2,10 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=500" />
|
||||||
<title>Popup</title>
|
<title>Popup</title>
|
||||||
<link rel="stylesheet" href="css/popup.css" />
|
<link rel="stylesheet" href="css/popup.css" />
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
<body></body>
|
<div id="popup-root"></div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -12,6 +12,7 @@ const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
|
|||||||
|
|
||||||
const manifestInput = require('./src/manifest');
|
const manifestInput = require('./src/manifest');
|
||||||
|
|
||||||
|
const viewsPath = path.join(__dirname, 'views');
|
||||||
const nodeEnv = process.env.NODE_ENV || 'development';
|
const nodeEnv = process.env.NODE_ENV || 'development';
|
||||||
const targetBrowser = process.env.TARGET_BROWSER;
|
const targetBrowser = process.env.TARGET_BROWSER;
|
||||||
const manifest = wextManifest[targetBrowser](manifestInput);
|
const manifest = wextManifest[targetBrowser](manifestInput);
|
||||||
@ -125,17 +126,17 @@ module.exports = {
|
|||||||
verbose: true,
|
verbose: true,
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: 'src/options.html',
|
template: path.join(viewsPath, 'popup.html'),
|
||||||
// inject: false,
|
inject: 'body',
|
||||||
chunks: ['options'],
|
|
||||||
filename: 'options.html',
|
|
||||||
}),
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
template: 'src/popup.html',
|
|
||||||
// inject: false,
|
|
||||||
chunks: ['popup'],
|
chunks: ['popup'],
|
||||||
filename: 'popup.html',
|
filename: 'popup.html',
|
||||||
}),
|
}),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: path.join(viewsPath, 'options.html'),
|
||||||
|
inject: 'body',
|
||||||
|
chunks: ['options'],
|
||||||
|
filename: 'options.html',
|
||||||
|
}),
|
||||||
new CopyWebpackPlugin([{ from: 'src/assets', to: 'assets' }]),
|
new CopyWebpackPlugin([{ from: 'src/assets', to: 'assets' }]),
|
||||||
new WriteWebpackPlugin([{ name: manifest.name, data: Buffer.from(manifest.content) }]),
|
new WriteWebpackPlugin([{ name: manifest.name, data: Buffer.from(manifest.content) }]),
|
||||||
extensionReloaderPlugin,
|
extensionReloaderPlugin,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user