Добавил сборку под платформы linux и win
This commit is contained in:
33
build/webpack.linux.config.js
Normal file
33
build/webpack.linux.config.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const distDir = path.resolve(__dirname, '../dist');
|
||||
const outDir = `${distDir}/linux`;
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: `${distDir}/public/index.html`,
|
||||
output: {
|
||||
path: outDir
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: 'null-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin([outDir], {root: distDir}),
|
||||
new DisableOutputWebpackPlugin(),
|
||||
new CopyWebpackPlugin([
|
||||
{ from: `${distDir}/public`, to: `${outDir}/public` }
|
||||
]
|
||||
),
|
||||
]
|
||||
};
|
||||
@@ -36,7 +36,7 @@ module.exports = merge(baseWpConfig, {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin([`${publicDir}`], {root: path.resolve(__dirname, '..')}),
|
||||
new CleanWebpackPlugin([publicDir], {root: path.resolve(__dirname, '..')}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].[contenthash].css"
|
||||
}),
|
||||
|
||||
33
build/webpack.win.config.js
Normal file
33
build/webpack.win.config.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const distDir = path.resolve(__dirname, '../dist');
|
||||
const outDir = `${distDir}/win`;
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: `${distDir}/public/index.html`,
|
||||
output: {
|
||||
path: outDir
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: 'null-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin([outDir], {root: distDir}),
|
||||
new DisableOutputWebpackPlugin(),
|
||||
new CopyWebpackPlugin([
|
||||
{ from: `${distDir}/public`, to: `${outDir}/public` }
|
||||
]
|
||||
),
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user