-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (47 loc) · 1.52 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
module.exports = {
entry: './public/app/main-almond.js',
output: {
// weird issue, without __dirname doesn't work
path: __dirname + "/dist/webpack",
filename: 'build.js',
},
resolve: {
alias: {
// weird issue, without __dirname doesn't work
"Block": __dirname + "/public/app/amd/Block.js",
// Notice, no resolution for jquery required, cause
// by default it searches an unspecified module in "/node_modules/<mod-name>/index.js"
}
},
module: {
// rules are only necessary if you want to skip the
// the "loader-name!" part in require().
rules: [
{
// you can always use "css!file/path.css" inside require() and skip this
test: /\.css$/,
use: [
'style-loader', // have to be npm install style-loader
'css-loader' // have to be npm install css-loader
]
},
{
// this is required because bootstrap.js internally uses fonts
test: /\.(woff|woff2|eot|ttf|otf|svg)$/,
use: [
'file-loader' // have to be npm install file-loader
]
}
// notice we did not give any rule for "html-loader"
// cause we are explicity calling it using "!" syntax when required
],
},
// the following is required because we didn't want to disturb
// the curl.js loader name "text". Otherwise not needed
resolveLoader: {
alias: {
// provides an alias name for the loader
'text': 'html-loader', // have to be npm install html-loader
},
},
};