initial commit
This commit is contained in:
commit
7d3c956806
38 changed files with 31353 additions and 0 deletions
22
configuration/environment.js
Normal file
22
configuration/environment.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
paths: {
|
||||
/* Path to source files directory */
|
||||
source: path.resolve(__dirname, '../src/'),
|
||||
|
||||
/* Path to built files directory */
|
||||
output: path.resolve(__dirname, '../dist/'),
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 4000,
|
||||
},
|
||||
limits: {
|
||||
/* Image files size in bytes. Below this value the image file will be served as DataURL (inline base64). */
|
||||
images: 8192,
|
||||
|
||||
/* Font files size in bytes. Below this value the font file will be served as DataURL (inline base64). */
|
||||
fonts: 8192,
|
||||
},
|
||||
};
|
38
configuration/webpack.dev.config.js
Normal file
38
configuration/webpack.dev.config.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
const webpackConfiguration = require('../webpack.config');
|
||||
const environment = require('./environment');
|
||||
|
||||
module.exports = merge(webpackConfiguration, {
|
||||
mode: 'development',
|
||||
|
||||
/* Manage source maps generation process */
|
||||
devtool: 'eval-source-map',
|
||||
|
||||
/* Development Server Configuration */
|
||||
devServer: {
|
||||
contentBase: environment.paths.output,
|
||||
watchContentBase: true,
|
||||
publicPath: '/',
|
||||
open: true,
|
||||
historyApiFallback: true,
|
||||
compress: true,
|
||||
overlay: true,
|
||||
hot: false,
|
||||
watchOptions: {
|
||||
poll: 300,
|
||||
},
|
||||
...environment.server,
|
||||
},
|
||||
|
||||
/* File watcher options */
|
||||
watchOptions: {
|
||||
aggregateTimeout: 300,
|
||||
poll: 300,
|
||||
ignored: /node_modules/,
|
||||
},
|
||||
|
||||
/* Additional plugins configuration */
|
||||
plugins: [],
|
||||
});
|
33
configuration/webpack.prod.config.js
Normal file
33
configuration/webpack.prod.config.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const { merge } = require('webpack-merge');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
||||
const webpackConfiguration = require('../webpack.config');
|
||||
|
||||
module.exports = merge(webpackConfiguration, {
|
||||
mode: 'production',
|
||||
|
||||
/* Manage source maps generation process. Refer to https://webpack.js.org/configuration/devtool/#production */
|
||||
devtool: false,
|
||||
|
||||
/* Optimization configuration */
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
}),
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
},
|
||||
|
||||
/* Performance treshold configuration values */
|
||||
performance: {
|
||||
maxEntrypointSize: 512000,
|
||||
maxAssetSize: 512000,
|
||||
},
|
||||
|
||||
/* Additional plugins configuration */
|
||||
plugins: [],
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue