Files
deployment-portal-fe/webpack.config.js
Abhishek Katiyar 4d05e5b71e [ch11577] | Abhishek | Add webpack configuration for local development
environment and add docker-compose.yaml
2020-05-27 05:37:41 +05:30

53 lines
1.4 KiB
JavaScript

const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
main: './src/index.tsx',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.css', '.scss'],
},
devServer: {
historyApiFallback: true,
host: '0.0.0.0',
hot: true,
port: 3000,
},
output: {
path: path.join(__dirname, '/dist'),
filename: `bundle.js?t=${new Date().getTime()}`,
publicPath: '/',
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('css-loader'),
},
{
test: /\.(sass|scss)$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader',
}),
},
],
},
plugins: [
new ExtractTextPlugin(`bundle.css?t=${new Date().getTime()}`),
new HtmlPlugin({
template: './index.html',
}),
new CopyPlugin([{ from: 'config.js' }]),
],
watchOptions: {
ignored: /node_modules/,
},
};