-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathwebpack.config.coffee
87 lines (70 loc) · 1.53 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
path = require 'path'
webpack = require 'webpack'
merge = require 'webpack-merge'
HtmlWebpackPlugin = require 'html-webpack-plugin'
# Paths
dir = (name) -> path.join __dirname, name
SRC_PATH = dir 'src'
BUILD_PATH = dir 'dist'
# The main config
module.exports =
# What file to start at
entry: [path.join SRC_PATH, 'index.js']
# Where to output
output:
path: BUILD_PATH
publicPath: '/'
filename: '[name].js'
# Where to load modules from
resolve:
root: SRC_PATH
modulesDirectories: ['node_modules']
extensions: ['', '.styl', '.js']
# Stylus options
stylus:
use: [(require 'nib')()]
# Stylint options
stylint:
config: 'stylint.json'
# Module loading options
module:
# Linters, etc.
preLoaders: [
# Stylint
test: /\.styl/
loaders: ['stylint']
]
# Files to load
loaders: [
# Pug
test: /\.pug$/
loaders: ['pug-html']
,
# Stylus
test: /\.styl$/
loaders: ['style', 'css', 'stylus']
]
plugins: [
# Generate HTML
new HtmlWebpackPlugin
template: path.join SRC_PATH, "index.pug"
# Hot module replacement
new webpack.HotModuleReplacementPlugin()
]
devServer:
# Serve publicly
host: '0.0.0.0'
# No iframe
inline: true
# Show progress
progress: true
# Hot reloading
hot: true
# Allow routing
historyApiFallback: true
# Display options
stats:
# Don't show a bunch of chunk stats
chunkModules: false
# Pretty colors
colors: true