work-it-out/webpack.config.js

50 lines
1.0 KiB
JavaScript

const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
entry: './src/index.ts', // Entry file
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.ink$/,
type: 'asset/source',
exclude: /node_modules/,
},
{
test: /\.s[ac]ss$/,
use: [
"style-loader", // Creates `style` nodes from JS strings
"css-loader", // Translates CSS into CommonJS
"sass-loader", // Compiles Sass to CSS
],
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
plugins: [
new HtmlWebpackPlugin({
title: "Work It Out",
template: "src/index.html",
})
],
devServer: {
static: {
directory: path.join(__dirname, 'dist'),
},
liveReload: true,
compress: true,
port: 9000,
},
};