This repository has been archived by the owner on Jul 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
webpack.config.ts
64 lines (61 loc) · 1.67 KB
/
webpack.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import webpack from 'webpack';
import HTMLPlugin from 'html-webpack-plugin';
import HTMLPartialPlugin from 'html-webpack-partials-plugin';
import CSSPlugin from 'mini-css-extract-plugin';
import { loader as TypedCSSLoader } from '@nice-labs/typed-css-modules';
const configuration: webpack.Configuration = {
context: __dirname,
devtool: 'source-map',
optimization: { splitChunks: { chunks: 'all' } },
resolve: { extensions: ['.ts', '.tsx', '.js', '.json'] },
module: {
rules: [
{ test: /\.tsx?$/, loader: require.resolve('ts-loader') },
{
test: /\.css$/,
use: [
CSSPlugin.loader,
{
loader: require.resolve('css-loader'),
options: { sourceMap: true },
},
],
},
{
test: /\.scss$/,
use: [
CSSPlugin.loader,
{
loader: require.resolve('css-loader'),
options: {
sourceMap: true,
importLoaders: 2,
modules: true,
esModule: true,
},
},
{
loader: TypedCSSLoader,
options: { mode: 'local' },
},
require.resolve('sassjs-loader'),
],
},
],
},
devServer: { hot: false, inline: false, https: true },
plugins: [
new HTMLPlugin({
title: 'Atorch Console',
favicon: require.resolve('./assets/ammeter.png'),
}),
new CSSPlugin({ filename: '[name].css' }),
new HTMLPartialPlugin({
path: require.resolve('./assets/analytics.html'),
location: 'head',
options: { id: 'UA-168944052-1' },
}),
],
stats: 'minimal',
};
export default configuration;