updated to latest versions
This commit is contained in:
+10
-6
@@ -1,4 +1,4 @@
|
||||
const merge = require('webpack-merge');
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
const path = require('path');
|
||||
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
|
||||
@@ -6,7 +6,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const prodFolderName = "prod-dist";
|
||||
|
||||
const replaceVersionInHtmlOption = {
|
||||
const replaceVersionInHtmlOption = {
|
||||
//set ?v= with new date in html files for production
|
||||
dir: path.join(__dirname, prodFolderName),
|
||||
test: /\.html$/,
|
||||
@@ -29,12 +29,16 @@ module.exports = merge(common, {
|
||||
filename: 'main.js'
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([
|
||||
new CopyWebpackPlugin(
|
||||
{
|
||||
from: path.resolve(__dirname, '*.html'),
|
||||
to: path.resolve(__dirname, prodFolderName, '[name].[ext]')
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(__dirname, 'index.html'),
|
||||
to: path.resolve(__dirname, prodFolderName, '[name].[ext]')
|
||||
}
|
||||
]
|
||||
}
|
||||
]),
|
||||
),
|
||||
new ReplaceInFileWebpackPlugin(
|
||||
[
|
||||
replaceVersionInHtmlOption
|
||||
|
||||
Reference in New Issue
Block a user