mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-14 03:07:57 +01:00
53 lines
1.0 KiB
JavaScript
53 lines
1.0 KiB
JavaScript
/** @type {import('webpack').Configuration} */
|
|
|
|
const path = require('path');
|
|
const { merge } = require('webpack-merge');
|
|
const common = require('../../webpack.common');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
const prodConfig = {
|
|
entry: {
|
|
app: path.join(__dirname, 'src', 'index.tsx'),
|
|
},
|
|
target: 'web',
|
|
output: {
|
|
filename: '[name].bundle.js',
|
|
path: path.resolve(__dirname, 'dist'),
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.wxml$/i,
|
|
type: 'asset/source',
|
|
}
|
|
],
|
|
},
|
|
optimization: {
|
|
chunkIds: 'named',
|
|
splitChunks: {
|
|
cacheGroups: {
|
|
vendors: {
|
|
test: /node_modules\/.*/,
|
|
name: 'vendors',
|
|
chunks: 'all',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{
|
|
from: 'public/*',
|
|
to: '[name].[ext]',
|
|
globOptions: {
|
|
ignore: ['**/index.html'],
|
|
},
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
};
|
|
|
|
module.exports = merge(common, prodConfig);
|