Initial commit AB#12
This commit is contained in:
39
app/webpack.config.js
Normal file
39
app/webpack.config.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const prod = process.env.NODE_ENV === 'production';
|
||||
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: prod ? 'production' : 'development',
|
||||
entry: './src/index.tsx',
|
||||
output: {
|
||||
path: __dirname + '/dist/',
|
||||
publicPath: '/'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(ts|js)x?$/,
|
||||
exclude: /node_modules/,
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||
},
|
||||
use: 'babel-loader',
|
||||
},
|
||||
{
|
||||
test: /\.(s(a|c)ss)$/,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
|
||||
}
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
historyApiFallback: true
|
||||
},
|
||||
devtool: prod ? undefined : 'source-map',
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html',
|
||||
}),
|
||||
new MiniCssExtractPlugin(),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user