-
Notifications
You must be signed in to change notification settings - Fork 132
/
webpack.conf.js
75 lines (74 loc) · 1.94 KB
/
webpack.conf.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
70
71
72
73
74
75
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: 'source-map',
entry: {
'bundle': './App/index.js',
'workers/obfuscation-worker': './App/workers/obfuscation-worker.js'
},
output: {
path: __dirname + '/dist',
filename: '[name].js',
globalObject: 'this'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.less$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options : {
publicPath : __dirname + '/dist'
}
},
'css-loader',
'less-loader'
]
},
{
test: /\.woff(2)?$/,
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'application/font-woff'
}
},
{
test: /\.(ttf|eot|svg)$/,
loader: 'file-loader'
},
{
test: /\.md$/i,
use: 'raw-loader'
}
]
},
resolve: {
alias: {
process: "process/browser"
}
},
plugins: [
new webpack.ProvidePlugin({
process: ['process']
}),
new HtmlWebpackPlugin({
inject: false,
template: './templates/index.html',
hash: true
}),
new MiniCssExtractPlugin()
]
};