37 lines
933 B
JavaScript
37 lines
933 B
JavaScript
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: 'IcyDraw canvas - Draw together!'
|
|
}), new MiniCssExtractPlugin()],
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist', 'public'),
|
|
filename: 'bundle.js',
|
|
},
|
|
devtool: 'source-map'
|
|
};
|