-
Notifications
You must be signed in to change notification settings - Fork 55
/
webpack.config.coffee
119 lines (108 loc) · 2.61 KB
/
webpack.config.coffee
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
webpack = require('webpack')
path = require('path')
appRoot = path.resolve "#{__dirname}", "app"
config =
mode: 'development'
entry: path.resolve "#{appRoot}", "app.coffee"
output:
path: path.resolve ".", "_build"
filename: 'socrat.js'
# devtool: 'source-map'
module:
rules: [
test: /\.(js|jsx)$/
exclude: /(node_modules|bower_components)/
use: 'babel-loader'
,
test: /\.less$/
use: ['style-loader', 'css-loader', 'less-loader']
,
test: /\.css$/
use: ['style-loader', 'css-loader']
,
test: /\.coffee$/
use: 'coffee-loader'
,
test: /\.jade$/
use: 'jade-loader'
,
test: /\.html$/,
use: 'html-loader'
,
# required for bootstrap icons
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/
type: 'asset/resource'
,
test: /\.(woff|woff2)$/
type: 'asset/inline'
,
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/
type: 'asset/inline'
,
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/
type: 'asset/inline'
,
test: /\.jpe?g$|\.gif$|\.png$/i
type: 'asset/inline'
,
test: /[\/\\]datavore-d0\.1\.js$/
use:
loader: 'exports-loader'
options:
exports: 'dv'
,
test: /[\/\\]highlight\.js$/
loader: 'exports-loader'
options:
type: 'commonjs'
exports: 'Highlight'
,
test: /[\/\\]dw\.js$/
use: [
loader: 'imports-loader'
options:
imports: 'named datavore dv'
,
loader: 'imports-loader'
options:
imports: 'named highlight Highlight'
,
loader: 'exports-loader'
options:
exports: 'dw'
]
,
test: /[\/\\]flat-ui\.js$/
use: 'imports-loader?this=>window'
,
test: /[\/\\]vega-dataflow\.js$|[\/\\]vega-view\.js$|[\/\\]vega-loader\.js$/i
use: 'babel-loader'
,
test: /[\/\\]d3-delaunay\.js$/
use: 'babel-loader'
]
resolve:
extensions: [
'.js'
'.coffee'
'.less'
'.css'
]
fallback:
"path": require.resolve 'path-browserify'
roots: [appRoot]
modules: [path.resolve(__dirname, 'app'), 'node_modules']
alias:
datavore: 'data-wrangler/lib/datavore/datavore-d0.1.js'
highlight: 'data-wrangler/lib/Highlight/highlight.js'
'jquery-ui': 'jquery-ui/ui/widgets'
plugins: [
new webpack.ContextReplacementPlugin /.*$/, /a^/
new webpack.ProvidePlugin
$: "jquery",
jQuery: "jquery",
'window.jQuery': "jquery"
new webpack.SourceMapDevToolPlugin
filename: "[file].map"
]
module.exports = config