mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2025-10-07 07:22:37 +02:00
use html-webpack-plugin to inject js file on build
This commit is contained in:
parent
a1bbd686c8
commit
23deb6fc2f
@ -7,7 +7,5 @@
|
||||
<link rel="stylesheet" href="css/options.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="js/options.js"></script>
|
||||
</body>
|
||||
<body></body>
|
||||
</html>
|
||||
|
||||
@ -7,7 +7,5 @@
|
||||
<link rel="stylesheet" href="css/popup.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="js/popup.js"></script>
|
||||
</body>
|
||||
<body></body>
|
||||
</html>
|
||||
|
||||
@ -21,6 +21,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.ProgressPlugin(),
|
||||
new FixStyleOnlyEntriesPlugin({ silent: true }),
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns: [path.join(process.cwd(), `extension/${process.env.TARGET}`)],
|
||||
@ -31,8 +32,18 @@ module.exports = {
|
||||
{ from: 'src/assets', to: 'assets' },
|
||||
{ from: `src/manifests/${process.env.TARGET}.json`, to: 'manifest.json' },
|
||||
]),
|
||||
new webpack.ProgressPlugin(),
|
||||
new HtmlWebpackPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'src/options.html',
|
||||
// inject: false,
|
||||
chunks: ['options'],
|
||||
filename: 'options.html',
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'src/popup.html',
|
||||
// inject: false,
|
||||
chunks: ['popup'],
|
||||
filename: 'popup.html',
|
||||
}),
|
||||
],
|
||||
|
||||
module: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user