Configured api and client for production builds

This commit is contained in:
ireic
2020-01-07 21:38:45 +01:00
parent 164cf2b137
commit 10e5696c63
13 changed files with 192 additions and 194 deletions

View File

@@ -5,26 +5,36 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
main: path.join(__dirname, 'src/index.js'),
main: path.join(__dirname, 'src/index.jsx'),
},
output: {
path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, 'build'),
filename: '[name]-[hash].js',
publicPath: '/',
},
module: {
rules: [
{
test: /\.js$/,
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: { sourceMap: true },
},
],
},
{
test: /\.(jpe?g|png|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: { name: '[name]-[hash].[ext]', limit: 15000 },
options: { name: '[name]-[hash].[ext]', limit: 10000 },
},
],
},
@@ -41,12 +51,12 @@ module.exports = {
},
resolve: {
modules: [path.join(__dirname, 'src'), 'node_modules'],
extensions: ['*', '.js', '.scss'],
extensions: ['*', '.js', '.jsx', '.css'],
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src/index.html'),
favicon: path.join(__dirname, 'src/global/assets/favicon.png'),
favicon: path.join(__dirname, 'src/favicon.png'),
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],