This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
54 lines (48 loc) · 1.49 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
module.exports = {
// Our initial entry point for the app
entry: './src/index.js',
// Where we output files
output: {
path: './dist',
filename: 'index.js'
},
// How do you resolve modules?
resolve: {
// Which directories should we pretend are the current directory too?
modulesDirectories: ['node_modules'],
// Which file extensions do we know about automatically?
// i.e. we don't have to specify their extension at require time.
//
// - the empty string means we can still specify an extension at require time
// - js files, duh
// - elm files
extensions: ['', '.js', '.elm']
},
module: {
loaders: [
// We want to output html files from our project in the output directory
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file?name=[name].[ext]'
},
// We want to load our elm files with the `elm-webpack` loader
// (but don't load our dependencies with it, or anything in node_modules)
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-hot!elm-webpack'
}
],
// Don't try to parse elm files, because they will never `require` another module
noParse: /\.elm$/
},
// Hey let's have a dev server
devServer: {
// We want the dev server inlined into the bundle for us
inline: true,
// Set the log level to only show us errors.
// Other options are: none, minimal, normal, verbose
stats: 'errors-only'
}
};