Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
94 lines (92 loc) · 2.16 KB
/
Copy pathwebpack.config.js
File metadata and controls
94 lines (92 loc) · 2.16 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var path = require('path');
var webpack = require('webpack');
// Generate queries.json file
require('./queries-to-json');
module.exports = [
{
node: {
fs: "empty"
},
entry: [
'./deps/jquery-2.1.0.js',
'./deps/chosen-1.1.0.js',
'./deps/fast-scroller.js',
'./src/ldf-client-ui.js',
'./src/ldf-client-url-state.js',
'./index.html',
'./styles/ldf-client.css',
'./images/chosen-sprite.png',
'./images/chosen-sprite@2x.png',
'./images/graphql.svg',
'./images/logo.svg',
'./images/settings.svg',
'./images/sparql.png',
'./favicon.ico',
'./queries.json',
],
output: {
filename: 'scripts/ldf-client-ui.min.js',
path: path.join(__dirname, '/build'),
libraryTarget: 'window',
},
plugins: [
new webpack.ProvidePlugin({
jQuery: path.join(__dirname, '/deps/jquery-2.1.0.js'),
}),
],
module: {
rules: [
{
type: 'javascript/auto',
test: /\.(json|html)$/,
use: [
{ loader: 'file-loader', options: { name: '[name].[ext]' } },
],
},
{
test: /\.(jpg|png|gif|svg|ico)$/,
use: [
{ loader: 'file-loader', options: { name: 'images/[name].[ext]' } },
],
},
{
test: /\.css$/,
use: [
{ loader: 'file-loader', options: { name: 'styles/[name].[ext]' } },
],
},
{ test: /images\/*\.svg$/, use: 'file-loader' },
],
},
},
{
node: {
fs: "empty"
},
entry: [
'./src/ldf-client-worker.js',
],
output: {
filename: 'scripts/ldf-client-worker.min.js',
path: path.join(__dirname, '/build'),
libraryTarget: 'this', // Fixes hot loading of web worker not working in Webpack
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.mjs$/,
type: 'javascript/auto',
},
],
},
plugins: [
new webpack.ProgressPlugin(),
],
},
];