Initial skeleton of the ustaxlib viewer.
[ustaxviewer.git] / webpack.config.js
1 const path = require('path');
2 const webpack = require('webpack');
3
4 const ROOT = path.resolve(__dirname, 'src');
5
6 module.exports = {
7 entry: {
8 main: './src/index.tsx'
9 },
10
11 resolve: {
12 extensions: ['.ts', '.tsx', '.js'],
13 modules: [
14 ROOT,
15 'node_modules'
16 ]
17 },
18
19 module: {
20 rules: [
21 {
22 test: /\.tsx?$/,
23 exclude: /node_modules/,
24 use: [
25 {
26 loader: 'babel-loader',
27 options: { presets: ['solid'] }
28 },
29 'ts-loader'
30 ]
31 },
32 {
33 test: /\.css$/,
34 use: [
35 'style-loader',
36 {
37 loader: 'css-loader',
38 options: {
39 modules: {
40 mode: 'local',
41 localIdentName: '[path][name]_[local]_[hash:base64:2]'
42 }
43 }
44 }
45 ]
46 }
47 ]
48 },
49
50 devServer: {
51 contentBase: 'public/'
52 },
53
54 devtool: 'cheap-module-eval-source-map',
55
56 plugins: [
57 new (require('html-webpack-plugin'))({
58 inject: true,
59 template: 'public/index.html'
60 }),
61 ]
62 };