-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
69 lines (69 loc) · 1.68 KB
/
webpack.config.js
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
65
66
67
68
69
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const htmlProcess = new HtmlWebpackPlugin({
filename: 'index.html',
template: './html/index.pug',
chunks: ['index'],
hash: true,
});
const extractSass = new ExtractTextPlugin({
filename: "[name].css",
});
module.exports = {
entry: { index: './ts/App.ts', img_calc: './ts/worker_threads/CalculateImgData.ts' },
context: __dirname + '/src',
output: {
path: __dirname + '/dist',
filename: 'js/[name].js'
},
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
devtool: 'source-map', // if we want a source map
module: {
rules: [{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: ['bower_components', 'node_modules']
},
{
test: /\.pug$/,
loader: 'pug-loader'
},
{
test: /\.(png|gif|jpg|svg|ttf|otf|woff|eof|eot|woff2)$/i,
loader: 'file-loader?name=static/[name].[ext]',
},
{
test: /\.purs$/,
loader: 'purs-loader',
options: {
// src: [
// 'bower_components/purescript-*/src/**/*.purs',
// 'src/**/*.purs'
// ],
bundle: false,
psc: 'psa',
pscIde: false,
exclude: ['bower_components', 'node_modules']
}
},
{
test: /\.hs$/,
loader: 'haskell-loader',
// query: {
// psc: 'psa',
// src: ['./purescripts/**/*.purs']
// }
},
{
test: /\.s[a|c]{1}ss$/,
use: extractSass.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader',
}),
}]
},
plugins: [htmlProcess, extractSass]
}