testpub-ssr
Version:
Test Pub SSR
51 lines (47 loc) • 1.15 kB
JavaScript
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const common = require('./webpack.common.js');
const paths = require('./paths');
const dotenv = require('dotenv-webpack');
module.exports = merge(common, {
entry: ['./index.tsx'],
mode: 'development',
devtool: 'inline-source-map',
devServer: {
historyApiFallback: true,
contentBase: paths.build,
open: false,
compress: true,
hot: true,
port: 8080,
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
'style-loader',
{
loader: 'css-loader',
options: { sourceMap: true },
},
{ loader: 'sass-loader', options: { sourceMap: true } },
],
},
],
},
plugins: [
new dotenv({
path: './.env.development',
systemvars: true,
ignoreStubs: true,
}),
new HtmlWebpackPlugin({
title: 'Selectives Component Library',
template: 'index.html',
filename: 'index.html',
}),
new webpack.HotModuleReplacementPlugin(),
],
});