mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: {
|
|
app: ['babel-polyfill', './src/index']
|
|
},
|
|
optimization: {
|
|
runtimeChunk: 'single',
|
|
splitChunks: {
|
|
chunks: 'all',
|
|
cacheGroups: {
|
|
commons: {
|
|
test: /[\\/]node_modules[\\/]/,
|
|
name: "vendor",
|
|
chunks: "initial",
|
|
minSize: 200000,
|
|
maxSize: 400000
|
|
},
|
|
styles: {
|
|
name: 'styles',
|
|
test: /\.css$/,
|
|
chunks: 'all'
|
|
}
|
|
}
|
|
}
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'public'),
|
|
filename: '[name].[contenthash].js',
|
|
publicPath: '/'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|ts)?$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
},
|
|
]
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/index.html'
|
|
}),
|
|
],
|
|
resolve: {
|
|
extensions: ['.js', '.ts']
|
|
},
|
|
devServer: {
|
|
historyApiFallback: true,
|
|
}
|
|
} |