2020-04-30 01:48:25 +03:00
|
|
|
const path = require('path');
|
|
|
|
// const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
// const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'production',
|
|
|
|
entry: {
|
|
|
|
app: './src/index.js'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2020-06-30 05:48:17 +03:00
|
|
|
test: /\.(j|t)sx?$/,
|
2020-04-30 01:48:25 +03:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
2020-06-20 07:45:52 +03:00
|
|
|
presets: ['@babel/preset-env', '@babel/typescript', '@babel/preset-react'],
|
2020-04-30 01:48:25 +03:00
|
|
|
plugins: [
|
2020-07-15 23:42:56 +03:00
|
|
|
'@babel/transform-runtime',
|
2020-04-30 01:48:25 +03:00
|
|
|
'@babel/plugin-proposal-object-rest-spread',
|
2020-06-19 01:04:30 +03:00
|
|
|
'@babel/plugin-proposal-optional-chaining',
|
|
|
|
'@babel/plugin-proposal-class-properties'
|
2020-04-30 01:48:25 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
exclude: /node_modules/
|
|
|
|
},
|
|
|
|
{
|
2020-06-19 01:04:30 +03:00
|
|
|
test: /\.css$/i,
|
2020-04-30 01:48:25 +03:00
|
|
|
use: [
|
|
|
|
// Creates `style` nodes from JS strings
|
|
|
|
'style-loader',
|
|
|
|
// Translates CSS into CommonJS
|
|
|
|
'css-loader',
|
|
|
|
// Compiles Sass to CSS
|
|
|
|
'sass-loader'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
2020-06-30 05:48:17 +03:00
|
|
|
extensions: ['.js', '.ts', '.tsx']
|
2020-04-30 01:48:25 +03:00
|
|
|
},
|
|
|
|
devtool: 'inline-source-map',
|
|
|
|
// devServer: {
|
|
|
|
// contentBase: path.join(__dirname, './'),
|
|
|
|
// hot: true,
|
|
|
|
// port: 9000,
|
|
|
|
// historyApiFallback: true
|
|
|
|
// },
|
|
|
|
plugins: [
|
|
|
|
// new CleanWebpackPlugin(),
|
|
|
|
// new HtmlWebpackPlugin({
|
|
|
|
// title: 'Hot Module Replacement',
|
|
|
|
// template: './public/index.html',
|
|
|
|
// }),
|
|
|
|
],
|
|
|
|
output: {
|
|
|
|
filename: 'index.js',
|
|
|
|
chunkFilename: 'index.js',
|
2020-06-30 05:48:17 +03:00
|
|
|
path: path.resolve(__dirname, '../../arvo/app/landscape/js'),
|
2020-04-30 01:48:25 +03:00
|
|
|
publicPath: '/'
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
usedExports: true
|
|
|
|
}
|
|
|
|
};
|