icy3dw/webpack.config.js

37 lines
978 B
JavaScript
Raw Normal View History

2022-04-09 11:29:54 +00:00
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: ['./src/client/index.ts', './src/client/scss/index.scss'],
module: {
rules: [
{
test: /\.(ts|js)?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-typescript',],
},
},
},
{
test: /\.(css|scss)/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
plugins: [new HtmlWebpackPlugin({
title: 'Icy3D World Experiment'
}), new MiniCssExtractPlugin()],
output: {
path: path.resolve(__dirname, 'dist', 'public'),
filename: 'bundle.js',
},
2022-04-10 08:33:52 +00:00
devtool: process.env.NODE_ENV !== 'production' ? 'source-map' : undefined,
2022-04-09 11:29:54 +00:00
};