Fix missing index.html in prod build
This commit is contained in:
parent
1191671656
commit
b3ddaeba74
2 changed files with 5 additions and 7 deletions
|
@ -3,6 +3,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const packageConfig = require('./package.json');
|
||||
const WorkboxPlugin = require('workbox-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
|
@ -14,6 +15,10 @@ module.exports = {
|
|||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html'
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const merge = require('webpack-merge');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'development',
|
||||
|
@ -16,12 +15,6 @@ module.exports = merge(common, {
|
|||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html'
|
||||
})
|
||||
],
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname, 'dist'),
|
||||
compress: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue